Skip to main content
DK.7
Associate III
January 2, 2022
Question

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

  • January 2, 2022
  • 2 replies
  • 2719 views

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
January 2, 2022

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
January 9, 2022