In the Xcode IDE, I have the option to set the C language dialect to one of
I understand what they mean except ANSI C. Because, as I know, ANSI C is only one of C89 or C99. But there must be a reason. What does the term ANSI C indicate there?
Assuming you essentially use GCC as a compiler, ANSI and C89 are aliases for the same thing. Cm:
http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#C-Dialect-Options
Apple , , . GCC . , , -ansi GCC (, C99).
. @Nicholas Knight XCode C: http://dl.dropbox.com/u/14571816/xcodelang.png
ANSI C , , ANSI C89 ( , C90). XCode GCC C, , , "", -ansi std=, , C .
-ansi
std=
, -ansi C, -std=c90, -std=c89 -std=iso9899:1990.
-std=c90
-std=c89
-std=iso9899:1990
-ansiC -std=c90. ++ -std=c++98.
C -std=c90. ++ -std=c++98.
-std=c++98
-std, .
-std
-std=. C ++.
-std=
. C ++.
:
c90c89iso9899:1990 ISO C90 ( GNU, ISO C90, ). , -ansi C.
c90
c89
iso9899:1990 ISO C90 ( GNU, ISO C90, ). , -ansi C.
iso9899:1990
iso9899:199409ISO C90, 1.
iso9899:199409
c99c9xiso9899:1999iso9899:199xISO C99. , ; http://gcc.gnu.org/gcc-4.5/c99status.html . c9x iso9899: 199x .
c99
c9x
iso9899:1999
iso9899:199x
ISO C99. , ; http://gcc.gnu.org/gcc-4.5/c99status.html . c9x iso9899: 199x .
gnu90gnu89GNU- ISO C90 ( C99). C .
gnu90
gnu89
GNU- ISO C90 ( C99). C .
gnu99gnu9xGNU- ISO C99. ISO C99 GCC, . gnu9x .
gnu99
gnu9x
GNU- ISO C99. ISO C99 GCC, . gnu9x .
C "" 70- .
1978 . , (1- ), "K & R C".
1988 . , ANSI (ISO), , , :)
, ANSI 1989 ( C89 ANSI C). ISO (C90), ANSI.
1999 ISO C: , C99.
, , ANSI C , ANSI C ISO C90 . , ANSI C ( ISO C99 , ).
Compilers have profiles of the languages ββthey target, for example, PMg said in its answer. ANSI C was one of the earliest profiles described in K & R.
An interesting question: why do compilers keep a list of obsolete language profiles? Because writing code with an ANSI C profile is a pretty strong guarantee that your code will work with almost any compiler (more importantly, the compiler version).
When software projects claim compatibility with ANSI-C, they tell you that they will compile everywhere when serving or receiving. Lua source code is an example of this.