cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE Indexer: False Positive Syntax Error with C11 _Generic

zmiga
Associate II

Hello everyone,

I am facing an issue with the STM32CubeIDE V1.17.0 indexer, where it highlights a syntax error when using the C11 _Generic primitive. Due to company project policies, I cannot upgrade to a newer version of the IDE at this time, so I need to find a solution or workaround for V1.17.0.

The indexer flags the code as a "Syntax error" as shown in the attached image:

zmiga_0-1768291216552.png

The PAR_SET macro is defined as follows:

zmiga_1-1768291243496.png

 

Key details:

  • There are no missing includes or path issues.

  • The code compiles successfully without any errors or warnings (GCC is happy).

  • Runtime performance is intact, and the macro functions exactly as expected.

The problem seems to be strictly with the indexer being unable to parse the C11 _Generic keyword correctly. Has anyone encountered this or found a way to "hint" the correct syntax to the indexer?

Any suggestions are greatly appreciated!

Best regards, Žiga

1 ACCEPTED SOLUTION

Accepted Solutions

@CTapp.1 wrote:

Probably the same underlying issue as reported here and here 


Indeed!

 


@CTapp.1 wrote:

basically seems to be a known Eclipse issue related to C11 language features. 


although the 2nd one isn't to do with C11 - it's GCC-specific "attribute" stuff.

Another one here - with C23

 

@zmiga in conclusion, this is a known "feature" of the Eclipse syntax analyser.

And it's not unique to Eclipse - other IDEs (eg, MSVC) also have similar "features" with their syntax analysers.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

View solution in original post

2 REPLIES 2
CTapp.1
Senior III

Probably the same underlying issue as reported here and here - basically seems to be a known Eclipse issue related to C11 language features. 

All posts are made in a personal capacity
MISRA C++ Chair
MISRA C WG Member
Director The MISRA Consortium Limited (TMCL)

@CTapp.1 wrote:

Probably the same underlying issue as reported here and here 


Indeed!

 


@CTapp.1 wrote:

basically seems to be a known Eclipse issue related to C11 language features. 


although the 2nd one isn't to do with C11 - it's GCC-specific "attribute" stuff.

Another one here - with C23

 

@zmiga in conclusion, this is a known "feature" of the Eclipse syntax analyser.

And it's not unique to Eclipse - other IDEs (eg, MSVC) also have similar "features" with their syntax analysers.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.