comparison gcc/doc/standards.texi @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents 77e2b8dfacca
children f6334be47118
comparison
equal deleted inserted replaced
56:3c8a44c06a95 63:b7f97abdc517
1 @c Copyright (C) 2000, 2001, 2002, 2004, 2006, 2007, 2008 Free Software Foundation, 1 @c Copyright (C) 2000, 2001, 2002, 2004, 2006, 2007, 2008, 2010
2 @c Inc. 2 @c Free Software Foundation, Inc.
3 @c This is part of the GCC manual. 3 @c This is part of the GCC manual.
4 @c For copying conditions, see the file gcc.texi. 4 @c For copying conditions, see the file gcc.texi.
5 5
6 @node Standards 6 @node Standards
7 @chapter Language Standards Supported by GCC 7 @chapter Language Standards Supported by GCC
31 @cindex C95 31 @cindex C95
32 @cindex ISO C99 32 @cindex ISO C99
33 @cindex C99 33 @cindex C99
34 @cindex ISO C9X 34 @cindex ISO C9X
35 @cindex C9X 35 @cindex C9X
36 @cindex ISO C1X
37 @cindex C1X
36 @cindex Technical Corrigenda 38 @cindex Technical Corrigenda
37 @cindex TC1 39 @cindex TC1
38 @cindex Technical Corrigendum 1 40 @cindex Technical Corrigendum 1
39 @cindex TC2 41 @cindex TC2
40 @cindex Technical Corrigendum 2 42 @cindex Technical Corrigendum 2
61 ANSI standard were renumbered and became clauses in the ISO standard. 63 ANSI standard were renumbered and became clauses in the ISO standard.
62 This standard, in both its forms, is commonly known as @dfn{C89}, or 64 This standard, in both its forms, is commonly known as @dfn{C89}, or
63 occasionally as @dfn{C90}, from the dates of ratification. The ANSI 65 occasionally as @dfn{C90}, from the dates of ratification. The ANSI
64 standard, but not the ISO standard, also came with a Rationale 66 standard, but not the ISO standard, also came with a Rationale
65 document. To select this standard in GCC, use one of the options 67 document. To select this standard in GCC, use one of the options
66 @option{-ansi}, @option{-std=c89} or @option{-std=iso9899:1990}; to obtain 68 @option{-ansi}, @option{-std=c90} or @option{-std=iso9899:1990}; to obtain
67 all the diagnostics required by the standard, you should also specify 69 all the diagnostics required by the standard, you should also specify
68 @option{-pedantic} (or @option{-pedantic-errors} if you want them to be 70 @option{-pedantic} (or @option{-pedantic-errors} if you want them to be
69 errors rather than warnings). @xref{C Dialect Options,,Options 71 errors rather than warnings). @xref{C Dialect Options,,Options
70 Controlling C Dialect}. 72 Controlling C Dialect}.
71 73
91 93
92 Errors in the 1999 ISO C standard were corrected in three Technical 94 Errors in the 1999 ISO C standard were corrected in three Technical
93 Corrigenda published in 2001, 2004 and 2007. GCC does not support the 95 Corrigenda published in 2001, 2004 and 2007. GCC does not support the
94 uncorrected version. 96 uncorrected version.
95 97
98 A fourth version of the C standard, known as @dfn{C1X}, is under
99 development; GCC has limited preliminary support for parts of this
100 standard, enabled with @option{-std=c1x}.
101
96 By default, GCC provides some extensions to the C language that on 102 By default, GCC provides some extensions to the C language that on
97 rare occasions conflict with the C standard. @xref{C 103 rare occasions conflict with the C standard. @xref{C
98 Extensions,,Extensions to the C Language Family}. Use of the 104 Extensions,,Extensions to the C Language Family}. Use of the
99 @option{-std} options listed above will disable these extensions where 105 @option{-std} options listed above will disable these extensions where
100 they conflict with the C standard version selected. You may also 106 they conflict with the C standard version selected. You may also
101 select an extended version of the C language explicitly with 107 select an extended version of the C language explicitly with
102 @option{-std=gnu89} (for C89 with GNU extensions) or @option{-std=gnu99} 108 @option{-std=gnu90} (for C90 with GNU extensions), @option{-std=gnu99}
103 (for C99 with GNU extensions). The default, if no C language dialect 109 (for C99 with GNU extensions) or @option{-std=gnu1x} (for C1X with GNU
104 options are given, is @option{-std=gnu89}; this will change to 110 extensions). The default, if no C language dialect
111 options are given, is @option{-std=gnu90}; this will change to
105 @option{-std=gnu99} in some future release when the C99 support is 112 @option{-std=gnu99} in some future release when the C99 support is
106 complete. Some features that are part of the C99 standard are 113 complete. Some features that are part of the C99 standard are
107 accepted as extensions in C89 mode. 114 accepted as extensions in C90 mode.
108 115
109 The ISO C standard defines (in clause 4) two classes of conforming 116 The ISO C standard defines (in clause 4) two classes of conforming
110 implementation. A @dfn{conforming hosted implementation} supports the 117 implementation. A @dfn{conforming hosted implementation} supports the
111 whole standard including all the library facilities; a @dfn{conforming 118 whole standard including all the library facilities; a @dfn{conforming
112 freestanding implementation} is only required to provide certain 119 freestanding implementation} is only required to provide certain
181 experimental C++0x mode in GCC@. The C++0x mode in GCC tracks the draft 188 experimental C++0x mode in GCC@. The C++0x mode in GCC tracks the draft
182 working paper for the C++0x standard; the latest working paper is 189 working paper for the C++0x standard; the latest working paper is
183 available on the ISO C++ committee's web site at 190 available on the ISO C++ committee's web site at
184 @uref{http://www.open-std.org/jtc1/sc22/wg21/}. For information 191 @uref{http://www.open-std.org/jtc1/sc22/wg21/}. For information
185 regarding the C++0x features available in the experimental C++0x mode, 192 regarding the C++0x features available in the experimental C++0x mode,
186 see @uref{http://gcc.gnu.org/gcc-4.3/cxx0x_status.html}. To select this 193 see @uref{http://gcc.gnu.org/projects/cxx0x.html}. To select this
187 standard in GCC, use the option @option{-std=c++0x}; to obtain all the 194 standard in GCC, use the option @option{-std=c++0x}; to obtain all the
188 diagnostics required by the standard, you should also specify 195 diagnostics required by the standard, you should also specify
189 @option{-pedantic} (or @option{-pedantic-errors} if you want them to be 196 @option{-pedantic} (or @option{-pedantic-errors} if you want them to be
190 errors rather than warnings). 197 errors rather than warnings).
191 198