Search code examples
cxcodeansi-cdialect

What's the term *ANSI C* specifies if it used with GNU89, C89, GNU99, C99?


In Xcode IDE, I have an option to set C language dialect one of

  • ANSI C
  • GNU89
  • C89
  • GNU99
  • C99
  • Compiler Default

I understand what they mean except ANSI C. Because As I know, ANSI C is just one of C89 or C99. But there should be a reason about it's on there. What's the term ANSI C specifies in there?


Solution

  • Assuming you are, in fact, using GCC as the compiler, ANSI and C89 are aliases for the same thing. See:

    http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#C-Dialect-Options

    Why Apple made the design decision to present them both, I'm not sure. There is no practical distinction in GCC. Perhaps they're being paranoid in case the meaning of -ansi changes in later versions of GCC (perhaps to C99).