2025-04-29 9:05 AM
I have
// Prevent a compiler warning on fall-through from one 'case' to another in
// a 'switch' statement
// https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html
#define INTENTIONAL_FALLTHROUGH __attribute__((fallthrough))
But the IDE flags it as a syntax error:
and it's not just the macro:
The usage is correct according to GCC documentation:
https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Statement-Attributes.html
This is purely in the editor - the actual compiler gives 0 errors and 0 warnings.
IDE v1.13.1 on Win 11.
Seems to be a known Eclipse issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=567227
2025-05-14 6:25 AM
Hello @Andrew Neil
Thanks for posting.
Please try to retest this issue using the latest version of STM32CubeIDE 1.18.1.
I'will be waiting for your feedback.
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-05-14 6:45 AM - edited 2025-05-14 6:48 AM
I'm seeing the same in 18.1.1:
(Not real code ;) )
Edited to add:
It looks like the parser doesn't like __attribute__ outside of a declaration, as this is "ok":
2025-05-14 7:24 AM
@CTapp.1 wrote:I'm seeing the same in 18.1.1:
Thanks - that saves me installing 1.18.1 !
(I'm in the middle of a project using 1.13.1, and have no want or reason to change at this point)
@CTapp.1 wrote:It looks like the parser doesn't like __attribute__ outside of a declaration
Confirmed that 1.13.1 does the same.
I guess the most usual use of __attribute__ is in declarations/definitions - the parser just doesn't handle this "special case"
2025-05-15 2:00 AM
@CTapp.1 spotted a similar issue with static_assert() at file scope:
2025-05-15 5:11 AM
Hello @Andrew Neil @CTapp.1
Thank you for bringing this issue to our attention.
A ticket has been escalated to dev team for further investigation.
Internal ticket number:209826
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.