cancel
Showing results for 
Search instead for 
Did you mean: 

expected declaration specifiers or '...' before numeric constant

DK.7
Senior

Happy New Year everyone!!!

Could you tell me why I get in STM32CubeIDE a warning "expected declaration specifiers or '...' before numeric constant"?

In this line:

__align(4) char variable[16] = ""; // buffer starts on 4-byte boundary

How to fix it?

2 REPLIES 2

Don't use directives (__align()) which are not supported by the compiler you are using.

If you use gcc, read https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#Common-Variable-Attributes

JW

Piranha
Chief II