Hiding false noreturn syntax errors in Eclipse CDT

169 Views Asked by At

Eclipse CDT doesn't know about the _Noreturn keyword and shows it as a syntax error.

A suggested workaround is to add an empty preprocessor macro entry to the CDT User Setting Entries, but apparently this has to be done in the project settings for every single project.

Is there a way to fix this globally for all projects, other than hiding all syntax errors completely? "CDT User Setting Entries" shows up in the global preferences under C/C++ > Build > Settings, but apparently cannot be edited there. (using Eclipse Oxygen.3a / 4.7.3a)

1

There are 1 best solutions below

0
On

On the mentioned preference page, you could edit the "Built-in Compiler Settings" provider's "Command to to get compiler specs" to add -D_Noreturn="".

Then, as long as your projects are configured to use the global "Built-in Compiler Settings" provider ("Use global provider shared between projects" checked in Project Properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers tab -> Built-in Compiler Settings provider), they will pick up this macro definition.

You could also consider contributing a fix to add propert support for _Noreturn to CDT.