Redundant redeclaration of SystemCoreClock

cancel
Showing results for 
Search instead for 
Did you mean: 

Redundant redeclaration of SystemCoreClock

Jump to solution
77 Views
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 Kudos
1 Solution
42 Views
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

View solution in original post

1 Reply
43 Views
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

View solution in original post