Next: Semantic Extensions, Previous: Using Assembly Language with C, Up: C Extensions [Contents][Index]
GNU C has traditionally supported numerous extensions to standard C syntax. Some of these features were originally intended for compatibility with other compilers or to ease traditional C compatibility, some have been adopted into subsequent versions of the C and/or C++ standards, while others remain specific to GNU C.
| • Statement Exprs: | Putting statements and declarations inside expressions. | |
| • Local Labels: | Labels local to a block. | |
| • Labels as Values: | Getting pointers to labels, and computed gotos. | |
| • Nested Functions: | Nested functions in GNU C. | |
| • Typeof: | typeof: referring to the type of an expression.
| |
| • Offsetof: | Special syntax for offsetof.
| |
| • Alignment: | Determining the alignment of a function, type or variable. | |
| • Enum Extensions: | Forward declarations and specifying the underlying type. | |
| • Boolean Type: | Support for the _Bool keyword.
| |
| • Variadic Macros: | Macros with a variable number of arguments. | |
| • Conditionals: | Omitting the middle operand of a ‘?:’ expression. | |
| • Case Ranges: | ‘case 1 ... 9’ and such. | |
| • Mixed Labels and Declarations: | Mixing declarations, labels and code. | |
| • C++ Comments: | C++ comments are recognized. | |
| • Escaped Newlines: | Slightly looser rules for escaped newlines. | |
| • Hex Floats: | Hexadecimal floating-point constants. | |
| • Binary constants: | Binary constants using the ‘0b’ prefix. | |
| • Dollar Signs: | Dollar sign is allowed in identifiers. | |
| • Character Escapes: | ‘\e’ stands for the character ESC. | |
| • Raw String Literals: | C++ raw string literals are supported in C. | |
| • Alternate Keywords: | __const__, __asm__, etc., for header files.
| |
| • Function Names: | Printable strings which are the name of the current function. |
Next: Semantic Extensions, Previous: Using Assembly Language with C, Up: C Extensions [Contents][Index]