standards.info: ANSI C
Go forward to Source Language
Go backward to Using Extensions
Go up to Design Advice
Go to the top op standards
ANSI C and pre-ANSI C
Do not ever use the "trigraph" feature of ANSI C.
ANSI C is widespread enough now that it is ok to write new programs
that use ANSI C features (and therefore will not work in non-ANSI
compilers). And if a program is already written in ANSI C, there's no
need to convert it to support non-ANSI compilers.
However, it is easy to support non-ANSI compilers in most programs,
so you might still consider doing so when you write a program. Instead
of writing function definitions in ANSI prototype form,
int
foo (int x, int y)
...
write the definition in pre-ANSI style like this,
int
foo (x, y)
int x, y;
...
and use a separate declaration to specify the argument prototype:
int foo (int, int);
You need such a declaration anyway, in a header file, to get the
benefit of ANSI C prototypes in all the files where the function is
called. And once you have it, you lose nothing by writing the function
definition in the pre-ANSI style.
If you don't know non-ANSI C, there's no need to learn it; just
write in ANSI C.
Created Wed Sep 1 16:42:53 2004 on bee with info_to_html version 0.9.6.