Redundant redeclaration of SystemCoreClock

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Redundant redeclaration of SystemCoreClock

跳至解决方案
1,881 次查看
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 解答
1,846 次查看
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 回复
1,847 次查看
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