Search code examples
ceclipse-cdtc89ansi-c

Why does GCC C89/C90 ANSI C use __STDC_VERSION__ in Eclipse?


I need to confirm my code if I'm using ANSI C (C89/C90) and I notice this:

enter image description here

Even if I have selected ASNI C (C89/C90) standard in Eclipse CDT.

enter image description here

Question:

It is told that ANSI C does not use __STDC_VERSION__ but why do I see the same value for __STDC_VERSION__ as 199901L for C99 standard in Eclipse CDT?

I'm using GCC compiler for Lubuntu Linux.


Solution

  • I have tested it. Eclipse CDT simply shows the oldest value programmed. It does not have anything in common with the actual __STDC_VALUE__ seen by the compiler.

    When you compile as C90 __STDC_VALUE__ is not defined and value shown in the Eclipse is not valid. I believe that it is an Eclipse bug.

    Colouring is also wrong.

    enter image description here