-std=
command-line option.
C2y can be explicitly selected with the -std=c2y
command-line flag, or -std=gnu2y
to enable GNU extensions
as well.
Feature | Proposal | Version | Notes |
---|---|---|---|
Generic selection expression with a type operand | N3260 | 15 | |
Support ++ and -- on complex values | N3259 | 3.0 | _Complex added in 3.0 |
Accessing byte arrays | N3254 | 15 | |
alignof of an incomplete array type. |
N3273 | 15 | |
Obsolete implicitly octal literals | N3353 | 15 | support for new syntax added but nothing deprecated yet (PR117028) |
Named loops | N3355 | 15 | |
Case range expressions | N3370 | 2.0 | |
if declarations |
N3356 | 15 | |
Introduce complex literals | N3298 | 2.5 | |
Allow zero length operations on null pointers | N3322 | 15 | compiler side only |
N3466 | 16 | ||
_Countof |
N3369, N3469 | 16 | |
Restartable Functions for Efficient Character Conversions | N3366 | No | Library issue; some predefined macros needed in the compiler |
Abs Without Undefined Behavior | N3349 | N/A | Library issue |
More Modern Bit Utilities | N3367 | N/A | Library issue; __builtin_stdc_rotate_left and
__builtin_stdc_rotate_right builtins added in
GCC 15 |
C23 mode is
the default since GCC 15; it can be explicitly selected with the
-std=c23
command-line flag, or -std=gnu23
to enable GNU extensions as well.
Feature | Proposal | Version | Notes |
---|---|---|---|
New keywords alignas , alignof ,
bool , false , static_assert ,
thread_local , true |
N2934, N2935 | 13 | |
_Static_assert with no message |
N2665 | 9 | support for _Static_assert with two arguments was added
in C11 and GCC 4.6 |
Removed support for function definitions with identifier lists | N2432 | 10 | removal of old-style function definitions |
Removal of unprototyped functions | N2841 | 13 | function declarations whose parameter list is empty are treated the
same as a parameter list which only contain a single void |
strftime supports %OB and %Ob
formats |
10 (format checking) | harmonization with ISO/IEC 9945; glibc support for these formats was added in glibc 2.27 | |
IEEE 754 decimal floating-point types (Optional) | N2341 | 4.3
(IA-32, x86-64, PowerPC, S/390) 13 (aarch64) |
DEC*_TRUE_MIN macros added in
GCC 10 |
IEEE 754 interchange and extended types (Optional) | N2601 | 7 (binary types) 15 (Annex H suffixes for decimal types and _Decimal64x ) |
|
Add *_NORM_MAX constants to <float.h> |
10 | ||
NaN and Inf macros in <float.h> |
11 | corresponding built-in functions __builtin_nansdN added |
|
*_IS_IEC_60559 macros in <float.h> |
11 | ||
__STDC_WANT_IEC_60559_EXT__ supported by <float.h> |
11 | ||
__STDC_VERSION_*_H__ header version macros |
13 | ||
Labels before declarations and end of blocks | N2508 | 11 | |
[[]] attribute syntax |
N2335, N2554 | 10 | |
__has_c_attribute preprocessor operator |
N2553 | 11 | |
[[deprecated]] |
N2334 | 10 | |
[[fallthrough]] |
N2408 | 10 | |
[[maybe_unused]] |
N2270, N2662 | 13 | support other than on labels added in GCC 10 |
[[nodiscard]] |
N2267, N2448 | 11 | |
[[noreturn]] |
N2764 | 13 | |
[[unsequenced]] and [[reproducible]] |
N2956 | 15 | |
u8 character constants |
N2418 | 10 | for char8_t see
N2653 |
Type change of u8 string literals |
N2653 | 13 | |
Introduce storage-class specifiers for compound literals | N3038 | 13 | |
The constexpr specifier for object definitions |
N3018 | 13 | |
Support for empty initializer braces | N2900 | 13 | some cases were already supported, but not scalars and VLAs |
typeof , typeof_unqual |
N2927, N2930 | 13 | typeof was previously supported as an extension |
Improved tag compatibility | N3037 | 14 | |
Bit-precise integer types (_BitInt ) |
N2763, N2775, N2969, N3035 | 14 (IA-32, x86-64 and AArch64 (little-endian) only) | |
Improved rules for handling enumerations without underlying types | N3029 | 3.0 | allows enums wider than int; adjusted in GCC 13 |
Enhanced Enumerations (fixed underlying types) | N3030 | 13 | |
#embed |
N3017 | 15 | |
nullptr constant |
N3042 | 13 | |
__VA_OPT__ |
N3033 | 8 | |
Parameter names may be omitted in function definitions | N2480 | 11 | |
Relax requirements for variadic parameter lists | N2975 | 13 | |
Identifier Syntax using Unicode Standard Annex 31 | N2836 | 13 | |
__has_include |
N2799 | 5 | |
Type inference for object definitions (auto ) |
N3007 | 13 | |
#elifdef , #elifndef preprocessor directives |
N2645 | 12 | |
#warning |
N2686 | 2.0 | |
Binary integer literals | N2549 | 4.3 | |
Formatting for input/output of binary integer numbers | 12 | mainly a glibc feature; GCC format checking support present | |
Digit separators | N2626 | 12 | |
unreachable macro in <stddef.h> |
N2826 | 13 | |
BOOL_MAX and BOOL_WIDTH macros in
<limits.h> |
11 | ||
ATOMIC_VAR_INIT removed |
N2886 | 13 | |
Removal of trigraphs | N2940 | 13 | can still be enabled using -trigraphs |
<stdckdint.h> header for checked integer arithmetic |
14 |
C17 can be explicitly selected with the -std=c17
command-line flag, or -std=gnu17
to enable GNU extensions
as well.
This was the default mode from GCC 8 to GCC 14 (including).
C11 can be explicitly selected with the -std=c11
command-line flag, or -std=gnu11
to enable GNU extensions
as well.
Feature | Proposal | Version | Notes |
---|---|---|---|
Atomics (_Atomic , <stdatomic.h> ) |
N1485, N1482 | 4.9 | |
Thread-local storage (_Thread_local ) |
N1364 | 4.9 | |
Additional floating-point characteristic macros (<float.h> ) |
4.6 | ||
Alignment support (_Alignas , _Alignof ,
max_align_t , <stdalign.h> ) |
N1397, N1447 | 4.7 | |
Unicode characters and strings (<uchar.h> ) |
N1488 | 4.7 | library part: glibc 2.16; originally specified in ISO/IEC TR
19769:2004; previously supported only with options such as
-std=gnu11 |
Type-generic expressions (_Generic ) |
N1441 | 4.9 | |
Static assertions (_Static_assert ) |
N1330 | 4.6 | static_assert in <assert.h> :
glibc 2.16 |
Anonymous structures and unions | N1406 | 4.6 | the basics were first added in GCC 3.0 |
Typedef redefinition | N1360 | 4.6 | |
Nonreturning functions (_Noreturn and
<stdnoreturn.h> ) |
N1478 | 4.7 | |
Macros to create complex numbers (<complex.h> ) |
N1464 | 4.7 | library part: glibc 2.16 |
Support for opening files for exclusive access | N/A | Library issue (glibc 2.x) | |
Remove the gets function (<stdio.h> ) |
N/A | Library issue (glibc 2.16) | |
aligned_alloc , at_quick_exit , and
quick_exit functions (<stdlib.h> ) |
N/A | Library issue (glibc 2.16) | |
struct timespec , timespec_get function
in <time.h> |
N/A | Library issue (glibc 2.16) | |
Threading, <threads.h> (Optional) |
N/A | Library issue (glibc 2.28) | |
Support for bounds-checking interfaces (Annex K, Optional) | N/A | Library issue (not implemented) | |
Support for analyzability (Annex L, Optional) | N/A |
C99 is substantially completely supported as of GCC 4.5
(with -std=c99 -pedantic-errors
used;
-fextended-identifiers
also needed to enable extended
identifiers before GCC 5), modulo bugs and floating-point
issues (mainly but not entirely relating to optional C99 features from
Annexes F and G). The following table gives more details of the C99
support in different GCC versions.
This table is based on the list in the foreword to N1256 (ISO/IEC 9899:1999 (E), consolidated with ISO/IEC 9899:1999/Cor.1:2001 (E), ISO/IEC 9899:1999/Cor.2:2004 (E) and ISO/IEC 9899:1999/Cor.3:2007 (E)).
The "Version" column indicates the first GCC version in which
support for the relevant feature was substantially present; some bugs
or corner cases may have been fixed in later versions; this column is
"N/A" if nothing is needed from the compiler for the feature to be
substantially supported (for example, if the feature refers to
addition of new library functions rather than language features), even
if additional compiler features could be useful in conjunction with
it. It is assumed that GCC is used with -std=c99
-pedantic-errors
(for versions 3.0 and later), as well
as -fextended-identifiers
in the case of that feature
before GCC 5.
Where library cooperation is required, it is assumed that a recent
version of the GNU C Library is in use, and support with other C
libraries may be less good. Where the version listed is before GCC
3.0, it should not be assumed that all corner cases follow C99 before
GCC 3.0, even if there is no specific note regarding corner cases.
See below the table for further notes on some issues.
Feature | Version | Notes |
---|---|---|
restricted character set support via digraphs and
<iso646.h> (originally specified in AMD1) |
GCC 2.7 | |
wide character library support in
<wchar.h> and <wctype.h>
(originally specified in AMD1) |
N/A | Library feature, no compiler support required. GCC doesn't
have wprintf , wscanf and
wcsftime format checking support. |
more precise aliasing rules via effective type | N/A | Optimization, no compiler support required. GCC has optimized based on aliasing rules since GCC 2.95. |
restricted pointers | GCC 2.95 | |
variable length arrays | GCC 0.9 | Various corner cases fixed in GCC 4.5. |
flexible array members | GCC 3.0 | |
static and type qualifiers in parameter array declarators |
GCC 3.1 | |
complex (and imaginary) support in <complex.h> |
GCC 3.0 | New functions are a library issue not requiring much compiler
support (some built-in functions present). Complex numbers are
supported with __complex__ since GCC 2.5, and with
C99 _Complex since GCC 3.0. Complex multiplication
and division support C99 special cases since GCC 4.0. Various
corner cases were fixed in GCC 4.5. GCC does not support the
Annex G imaginary types, but this support is optional, and complex
multiplication and division have excess overflows at runtime
(although not beyond those permitted by C99). |
type-generic math macros in <tgmath.h> |
N/A | Library feature; GCC built-in functions may be used in implementing it. |
the long long int type and library functions |
≤ GCC 1.27 | New functions are a library issue not requiring much compiler support (some built-in functions present). |
increased minimum translation limits | GCC 0.9 | GNU policy has always avoided arbitrary limits. |
additional floating-point characteristics in <float.h> |
GCC 3.0 | |
remove implicit int |
GCC 3.0 | |
reliable integer division | GCC 0.9 | |
universal character names (\u and \U ) |
GCC 3.1 | |
extended identifiers | GCC 4.1 | Some corner cases were fixed in GCC 5;
-fextended-identifiers was needed to enable this
feature before that version. |
hexadecimal floating-point constants and
%a and %A
printf /scanf conversion specifiers |
GCC 2.8 | Conversion specifiers are a library issue (format checking support present). |
compound literals | GCC 3.1 | The syntax was supported by GCC by version 1.21, but with significant differences from C99 requirements until GCC 3.1. |
designated initializers | GCC 3.0 | The syntax was supported since GCC 2.5, but with significant differences from C99 requirements until GCC 3.0. |
// comments |
GCC 2.7 | |
extended integer types and library functions
in <inttypes.h>
and <stdint.h> |
N/A | All of this can be provided by the library rather than the
compiler (some built-in function support also
present). <stdint.h> is provided by GCC (as of
version 4.5), or fixed where the system headers provide a
nonconforming version, on some but not yet all systems. On
systems where types in this header have been defined
as char , GCC retains this definition although it is
not permitted by C99. |
remove implicit function declaration | GCC 3.0 | |
preprocessor arithmetic done in intmax_t /uintmax_t |
GCC 3.3 | |
mixed declarations and code | GCC 3.0 | |
new block scopes for selection and iteration statements | GCC 3.0 | |
integer constant type rules | GCC 3.3 | |
integer promotion rules | GCC 4.0 | |
macros with a variable number of arguments | GCC 2.95 | |
the vscanf family of functions
in <stdio.h> and <wchar.h> |
N/A | Library feature, no compiler support required (format checking support present). |
additional math library functions in <math.h> |
N/A | Library feature, no compiler support required (various built-in functions present). |
treatment of error conditions by math library functions (math_errhandling ) |
N/A | Library feature, no compiler support required. |
floating-point environment access in <fenv.h> |
N/A | Library feature, no compiler support required. |
IEC 60559 (also known as IEC 559 or IEEE arithmetic) support | Optional feature, not properly supported in GCC. | |
trailing comma allowed in enum declaration |
GCC 0.9 | |
%lf conversion specifier allowed in printf |
N/A | Library feature, no compiler support required (format checking support present). |
inline functions | GCC 4.3 | Inline function support present since at least GCC 1.21, but with major differences from C99 semantics until 4.3. |
the snprintf family of functions in <stdio.h> |
N/A | Library feature, no compiler support required (format checking support present). |
boolean type in <stdbool.h> |
GCC 3.0 | GCC 2.95 had <stdbool.h> , but based on an
early draft with major differences from C99 semantics. |
idempotent type qualifiers | GCC 3.0 | Always has been allowed, with a warning as required by C90 depending on GCC version. |
empty macro arguments | GCC 0.9 | Undefined behavior in C90, but GCC not known ever to have handled them contrary to C99. |
new structure type compatibility rules (tag compatibility) | GCC 0.9 | This relates to compatibility between translation units. |
additional predefined macro names | GCC 3.0 | Support for the compiler to implicitly preinclude a
file stdc-predef.h provided by the C library, and so
predefine macros relating to library properties for the whole
translation unit, is new in GCC 4.8. |
_Pragma preprocessing operator |
GCC 3.0 | |
standard pragmas | Not implemented. Associated command-line options to control the state of the pragmas for the whole translation unit are available. | |
__func__ predefined identifier |
GCC 2.95 | |
va_copy macro |
GCC 3.0 | |
additional strftime conversion specifiers |
N/A | Library feature, no compiler support required (format checking support present). |
LIA compatibility annex | N/A | This annex describes how C relates to another standard, and does not impose any requirements on C implementations. |
deprecate ungetc at the beginning of a binary file |
N/A | Library feature, no compiler support required. |
remove deprecation of aliased array parameters | GCC 0.9 | GCC has never done anything regarding this deprecation. |
conversion of array to pointer not limited to lvalues | GCC 3.1 | Some support since GCC 2.0, but with major differences from C99 requirements before GCC 3.1. |
relaxed constraints on aggregate and union initialization | ≤ GCC 1.21 | |
relaxed restrictions on portable header names | GCC 0.9 | GCC has never had such restrictions itself. |
return without expression not permitted
in function that returns a value (and vice versa) |
GCC 3.0 |
-std=c90
command-line flag, or -std=gnu90
to enable GNU extensions as well.
__STDC_IEC_559__
or implement the associated standard
pragmas; nor do some options such as -frounding-math
to
enable the pragmas globally work in all cases (for example, required
exceptions may not be generated) and contracting expressions (e.g.,
using fused multiply-add) is not restricted to source-language
expressions as required by C99.math_errhandling
the
compiler needs to mark its output from compilations using
-fno-trapping-math
or -fno-math-errno
,
possibly using
the .gnu_attribute
mechanism, to indicate that built-in
function optimizations may have been applied that mean that not all
calls report error status in a particular way; the static linker
needs to put this information in executables and shared libraries and
the C library needs to use it to set math_errhandling
at
startup to a conservatively correct value based on the information
from the compiler. There is currently some limited GNU C Library
support that only conforms as long as the above options are not used
anywhere in the program.const
-qualified compound literals could share storage
with each other and with string literals, but currently don't.static
in parameter array
declarators is not used for optimization. It might make sense to use
it in future in conjunction with work
on prefetching.Copyright (C) Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
These pages are maintained by the GCC team. Last modified 2025-08-08.
peb是什么意思 | 手上长小水泡是什么原因 | 尪痹片主治什么 | 辛亥革命是什么时候 | 努嘴是什么意思 |
大三阳吃什么药好 | psd是什么意思 | kenwood是什么牌子 | 胃癌吃什么药 | 什么是金砖国家 |
8月28日什么星座 | 亲密是什么意思 | 渡劫是什么意思 | 乳香是什么东西 | 喝什么茶不影响睡眠 |
寒疾现代叫什么病 | 阴道口有点痒用什么药 | 水猴子是什么 | 破伤风什么时候打最好 | 老年性脑改变是什么意思 |
杏仁吃了有什么好处hcv7jop5ns4r.cn | 查乳腺挂什么科hcv7jop5ns0r.cn | 妈妈的表妹叫什么hcv8jop9ns3r.cn | 胃间质瘤是什么性质的瘤hcv7jop7ns2r.cn | 口苦口干是什么原因造成的hcv7jop6ns1r.cn |
57年属什么生肖hcv9jop4ns0r.cn | nsa是什么意思hcv8jop9ns6r.cn | 清炖羊肉放什么调料hcv8jop4ns0r.cn | 右耳痒是什么预兆hcv8jop6ns9r.cn | 血压过低有什么危害hcv8jop8ns0r.cn |
三教九流什么意思xinjiangjialails.com | 马走日是什么意思xianpinbao.com | 邮政ems是什么意思hcv9jop0ns6r.cn | 尿潴留是什么病hcv8jop1ns9r.cn | 老年人脚肿吃什么药hcv8jop7ns5r.cn |
女人喝什么调节内分泌hcv7jop6ns4r.cn | 8月底是什么星座hcv9jop2ns6r.cn | ena是什么检查项目hcv8jop2ns9r.cn | 脂肪肝能吃什么水果hcv8jop3ns9r.cn | 2016年属什么生肖aiwuzhiyu.com |