2025-05-15 1:43 AM - last edited on 2025-05-15 1:58 AM by Andrew Neil
Split from CubeIDE incorrectly flags __attribute__((fallthrough)) as syntax error.
I've also noticed it doesn't like the use of static_assert at file scope:
Solved! Go to Solution.
2025-05-15 5:12 AM
Hello @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.
2025-05-15 5:12 AM
Hello @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.
2026-03-11 1:33 AM
I have a simple workaround: add
// Next 3 lines prevent bogus error reports in _Static_assert and static_assert
#ifndef __BASE_FILE__ // __BASE_FILE__ known to GCC, not IDT
#define _Static_assert(c,m) typedef int static_assertion[(c)?1:-1]
#endifThat should be early in a .c file, or in a .h file included early, before #include <assert.h> or anything that does, or any use of _Static_assert or static_assert .
I wish the present workaround could be linked to that similar question, which is frozen.
François Grieu
2026-03-13 3:53 AM
Better will be :
To ensures that _Static_assert is recognized properly by the IDE during indexer parsing.
In Project → Properties → C/C++ General → Preprocessor Include Paths, Macros, etc.:
Go to the Providers tab and make sure CDT User Setting Entries is checked.
Then, switch to the Entries tab → expand GNU C under CDT User Setting Entries, and add the following macro:
_Static_assert(a,b)