Redundant redeclaration of SystemCoreClock

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Redundant redeclaration of SystemCoreClock

ソリューションへジャンプ
2,172件の閲覧回数
Armandas
Contributor I

I am using a MCUXpresso IDE V11.3.1 to generate board configuration files for MKE16Z series device.

I have enabled extra warnings in my project, among them "-Wredundant-decls". With this option, the compiler produces the following warning in board/clock_config.c:

 

../../../board/clock_config.c:46:17: error: redundant redeclaration of 'SystemCoreClock' [-Werror=redundant-decls]
   46 | extern uint32_t SystemCoreClock;
      |                 ^~~~~~~~~~~~~~~
In file included from ../../../lib/NXP_MKE16Z64/devices/MKE16Z4/MKE16Z4.h:137,
                 from ../../../lib/NXP_MKE16Z64/devices/MKE16Z4/fsl_device_registers.h:24,
                 from ../../../lib/NXP_MKE16Z64/devices/MKE16Z4/drivers/fsl_common.h:22,
                 from ../../../board/clock_config.h:9,
                 from ../../../board/clock_config.c:34:
../../../lib/NXP_MKE16Z64/devices/MKE16Z4/system_MKE16Z4.h:90:17: note: previous declaration of 'SystemCoreClock' was here

Since the declaration is already present in system_MKE16Z4.h, the generator should be updated to remove the duplicate declaration.

 

0 件の賞賛
返信
1 解決策
2,137件の閲覧回数
marek_neuzil
NXP Employee
NXP Employee

Hello,

Thank you for reporting the issue. The redundant declaration of SystemCoreClock variable will be removed from the generated code of the clock initialization source code. It will be fixed in a next release.

Best Regards,

Marek Neuzil

元の投稿で解決策を見る

1 返信
2,138件の閲覧回数
marek_neuzil
NXP Employee
NXP Employee

Hello,

Thank you for reporting the issue. The redundant declaration of SystemCoreClock variable will be removed from the generated code of the clock initialization source code. It will be fixed in a next release.

Best Regards,

Marek Neuzil