Skip to main content
Ghofrane GSOURI
Ghofrane GSOURIBest answer
ST Technical Moderator

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.

3 replies

Ghofrane GSOURI
Ghofrane GSOURIBest answer
ST Technical Moderator

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.
FGrie.3
Associate

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]
#endif

That 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

Radosław
Associate II

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)