* gcc:(gcc). the gnu compiler collection.---"(gnu tools for arm embedded processors)"
2.1 c language
==============
gcc supports three versions of the c standard, although support for the most recent version isnot yet complete.
the original ansi c standard (x3.159-1989) was ratified in 1989 andpublishedin 1990. this standard was ratified as an iso standard (iso/iec 9899:1990) later in 1990. there were no technical differences between these publications, although the sections of the ansi standard were renumbered and became clauses in the iso standard. this standard,in both its forms,is commonly known as "c89",or occasionally as "c90", from the dates of ratification. the ansi standard, but not the iso standard, also came with a rationale document.toselect this standard in gcc, use one of the options `-ansi', `-std=c90'or `-std=iso9899:1990';to obtain all the diagnostics required by the standard, you should also specify `-pedantic'(or `-pedantic-errors'if you want them to be errors rather than warnings).*note options controlling c dialect: c dialect options.
errors in the 1990 iso c standard were corrected in two technical corrigenda publishedin 1994 and 1996. gcc does not support the uncorrected version.
an amendment to the 1990 standard was publishedin 1995. this amendment added digraphs and `__stdc_version__'to the language, but otherwise concerned the library. this amendment is commonly known as "amd1"; the amended standard is sometimes known as "c94"or"c95".toselect this standard in gcc, use the option `-std=iso9899:199409'(with, as for other standard versions, `-pedantic'to receive all required diagnostics).
a new edition of the iso c standard was publishedin 1999 as iso/iec 9899:1999,andis commonly known as "c99". gcc has incomplete support for this standard version; see `http://gcc.gnu.org/c99status.html'for details.toselect this standard, use `-std=c99'or `-std=iso9899:1999'.(whilein development, drafts of this standard version were referred to as "c9x".)
errors in the 1999 iso c standard were corrected in three technical corrigenda publishedin 2001, 2004 and 2007. gcc does not support the uncorrected version.
a fourth version of the c standard, known as "c11", was publishedin 2011 as iso/iec 9899:2011. gcc has limited incomplete support for parts of this standard, enabled with `-std=c11'or `-std=iso9899:2011'.(whilein development, drafts of this standard version were referred to as "c1x".)
by default,gcc provides some extensions to the c language that on rare occasions conflict with the c standard.*note extensions to the c language family: c extensions. use of the `-std' options listed above will disable these extensions where they conflict with the c standard version selected. you may also select an extended version of the c language explicitly with `-std=gnu90'(for c90 with gnu extensions), `-std=gnu99'(for c99 with gnu extensions)or `-std=gnu11'(for c11 with gnu extensions). the default,if no c language dialect options are given,is `-std=gnu90'; this will change to `-std=gnu99'or `-std=gnu11'in some future release when the c99 or c11 support is complete. some features that are part of the c99 standard are accepted as extensions in c90 mode,and some features that are part of the c11 standard are accepted as extensions in c90 and c99 modes.
gcc does not provide the library facilities required only of hosted implementations, nor yet all the facilities required by c99 of freestanding implementations;to use the facilities of a hosted environment,you will need to find them elsewhere (for example,in the gnu c library).*note standard libraries: standard libraries.
点击(此处)折叠或打开
6 extensions to the c language family
*************************************
gnu c provides several language features not found in iso standard c.
(the `-pedantic'option directs gcc to print a warning message if any
of these features is used.)to test for the availability of these
features in conditional compilation,check for a predefined macro
`__gnuc__', which is always defined under gcc.
these extensions are available in c and objective-c. most of them are
also available in c.*note extensions to the c language: c
extensions,for extensions that apply _only_ to c.
some features that are in iso c99 but not c90 or c are also, as
extensions, accepted by gcc in c90 mode andin c.
6.20 macros with a variable number of arguments.
================================================
in the iso c standard of 1999, a macro can be declared to accept a
variable number of arguments much as a function can. the syntax for
defining the macro is similar to that of a function. here is an