Skip to main content
DK.7
Associate III
Jan 2, 2022 10:03 AM UTC
Question

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

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?

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
Jan 2, 2022 1:50 PM UTC

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
Principal III
Jan 9, 2022 8:25 PM UTC