[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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++. See section Extensions to the C++ Language, 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 and in C++.
6.1 Statements and Declarations in Expressions | Putting statements and declarations inside expressions. | |
6.2 Locally Declared Labels | Labels local to a block. | |
6.3 Labels as Values | Getting pointers to labels, and computed gotos. | |
6.4 Nested Functions | As in Algol and Pascal, lexical scoping of functions. | |
6.5 Constructing Function Calls | Dispatching a call to another function. | |
6.6 Referring to a Type with typeof | typeof : referring to the type of an expression.
| |
6.7 Conditionals with Omitted Operands | Omitting the middle operand of a ‘?:’ expression. | |
6.8 128-bit integers | 128-bit integers—__int128 .
| |
6.9 Double-Word Integers | Double-word integers—long long int .
| |
6.10 Complex Numbers | Data types for complex numbers. | |
6.11 Additional Floating Types | ||
6.12 Half-Precision Floating Point | ||
6.13 Decimal Floating Types | ||
6.14 Hex Floats | Hexadecimal floating-point constants. | |
6.15 Fixed-Point Types | ||
6.16 Named Address Spaces | Named address spaces. | |
6.17 Arrays of Length Zero | Zero-length arrays. | |
6.18 Structures With No Members | Structures with no members. | |
6.19 Arrays of Variable Length | Arrays whose length is computed at run time. | |
6.20 Macros with a Variable Number of Arguments. | Macros with a variable number of arguments. | |
6.21 Slightly Looser Rules for Escaped Newlines | Slightly looser rules for escaped newlines. | |
6.22 Non-Lvalue Arrays May Have Subscripts | Any array can be subscripted, even if not an lvalue. | |
6.23 Arithmetic on void - and Function-Pointers | Arithmetic on void -pointers and function pointers.
| |
6.24 Non-Constant Initializers | Non-constant initializers. | |
6.25 Compound Literals | Compound literals give structures, unions or arrays as values. | |
6.26 Designated Initializers | Labeling elements of initializers. | |
6.27 Case Ranges | ‘case 1 ... 9’ and such. | |
6.28 Cast to a Union Type | Casting to union type from any member of the union. | |
6.29 Mixed Declarations and Code | Mixing declarations and code. | |
6.30 Declaring Attributes of Functions | Declaring that functions have no side effects, or that they can never return. | |
6.31 Attribute Syntax | Formal syntax for attributes. | |
6.32 Prototypes and Old-Style Function Definitions | Prototype declarations and old-style definitions. | |
6.33 C++ Style Comments | C++ comments are recognized. | |
6.34 Dollar Signs in Identifier Names | Dollar sign is allowed in identifiers. | |
6.35 The Character <ESC> in Constants | ‘\e’ stands for the character <ESC>. | |
6.36 Specifying Attributes of Variables | Specifying attributes of variables. | |
6.37 Specifying Attributes of Types | Specifying attributes of types. | |
6.38 Inquiring on Alignment of Types or Variables | Inquiring about the alignment of a type or variable. | |
6.39 An Inline Function is As Fast As a Macro | Defining inline functions (as fast as macros). | |
6.40 When is a Volatile Object Accessed? | What constitutes an access to a volatile object. | |
6.41 Assembler Instructions with C Expression Operands | Assembler instructions with C expressions as operands. (With them you can define “built-in” functions.) | |
6.42 Constraints for asm Operands | Constraints for asm operands | |
6.43 Controlling Names Used in Assembler Code | Specifying the assembler name to use for a C symbol. | |
6.44 Variables in Specified Registers | Defining variables residing in specified registers. | |
6.45 Alternate Keywords | __const__ , __asm__ , etc., for header files.
| |
6.46 Incomplete enum Types | enum foo; , with details to follow.
| |
6.47 Function Names as Strings | Printable strings which are the name of the current function. | |
6.48 Getting the Return or Frame Address of a Function | Getting the return or frame address of a function. | |
6.49 Using Vector Instructions through Built-in Functions | Using vector instructions through built-in functions. | |
6.50 Offsetof | Special syntax for implementing offsetof .
| |
6.51 Legacy __sync Built-in Functions for Atomic Memory Access | Legacy built-in functions for atomic memory access. | |
6.52 Built-in functions for memory model aware atomic operations | Atomic built-in functions with memory model. | |
6.53 x86 specific memory model extensions for transactional memory | x86 memory models. | |
6.54 Object Size Checking Built-in Functions | Built-in functions for limited buffer overflow checking. | |
6.55 Other Built-in Functions Provided by GCC | Other built-in functions. | |
6.56 Built-in Functions Specific to Particular Target Machines | Built-in functions specific to particular targets. | |
6.57 Format Checks Specific to Particular Target Machines | Format checks specific to particular targets. | |
6.58 Pragmas Accepted by GCC | Pragmas accepted by GCC. | |
6.59 Unnamed struct/union fields within structs/unions | ||
6.60 Thread-Local Storage | Per-thread variables. | |
6.61 Binary constants using the ‘0b’ prefix |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on October 19, 2013 using texi2html 5.0.