[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5. Extensions to the C Language Family

GNU C provides several language features not found in ISO standard C. (The `-pedantic' option directs GNU CC 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 GNU CC.

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 C89 or C++ are also, as extensions, accepted by GCC in C89 mode and in C++.

5.1 Statements and Declarations in Expressions  Putting statements and declarations inside expressions.
5.2 Locally Declared Labels  Labels local to a statement-expression.
5.3 Labels as Values  Getting pointers to labels, and computed gotos.
5.4 Nested Functions  As in Algol and Pascal, lexical scoping of functions.
5.5 Constructing Function Calls  Dispatching a call to another function.
5.6 Naming an Expression's Type  Giving a name to the type of some expression.
5.7 Referring to a Type with typeof  typeof: referring to the type of an expression.
5.8 Generalized Lvalues  Using `?:', `,' and casts in lvalues.
5.9 Conditionals with Omitted Operands  Omitting the middle operand of a `?:' expression.
5.10 Double-Word Integers  Double-word integers---long long int.
5.11 Complex Numbers  Data types for complex numbers.
5.12 Hex Floats  Hexadecimal floating-point constants.
5.13 Arrays of Length Zero  Zero-length arrays.
5.14 Arrays of Variable Length  Arrays whose length is computed at run time.
5.15 Macros with a Variable Number of Arguments.  Macros with a variable number of arguments.
5.16 Slightly Looser Rules for Escaped Newlines  Slightly looser rules for escaped newlines.
5.17 String Literals with Embedded Newlines  String literals with embedded newlines.
5.18 Non-Lvalue Arrays May Have Subscripts  Any array can be subscripted, even if not an lvalue.
5.19 Arithmetic on void- and Function-Pointers  Arithmetic on void-pointers and function pointers.
5.20 Non-Constant Initializers  Non-constant initializers.
5.21 Compound Literals  Compound literals give structures, unions or arrays as values.
5.22 Designated Initializers  Labeling elements of initializers.
5.24 Cast to a Union Type  Casting to union type from any member of the union.
5.23 Case Ranges  `case 1 ... 9' and such.
5.25 Mixed Declarations and Code  Mixing declarations and code.
5.26 Declaring Attributes of Functions  Declaring that functions have no side effects, or that they can never return.
5.27 Attribute Syntax  Formal syntax for attributes.
5.28 Prototypes and Old-Style Function Definitions  Prototype declarations and old-style definitions.
5.29 C++ Style Comments  C++ comments are recognized.
5.30 Dollar Signs in Identifier Names  Dollar sign is allowed in identifiers.
5.31 The Character ESC in Constants  `\e' stands for the character ESC.
5.33 Specifying Attributes of Variables  Specifying attributes of variables.
5.34 Specifying Attributes of Types  Specifying attributes of types.
5.32 Inquiring on Alignment of Types or Variables  Inquiring about the alignment of a type or variable.
5.35 An Inline Function is As Fast As a Macro  Defining inline functions (as fast as macros).
5.36 Assembler Instructions with C Expression Operands  Assembler instructions with C expressions as operands.
                         (With them you can define "built-in" functions.)
5.37 Controlling Names Used in Assembler Code  Specifying the assembler name to use for a C symbol.
5.38 Variables in Specified Registers  Defining variables residing in specified registers.
5.39 Alternate Keywords  __const__, __asm__, etc., for header files.
5.40 Incomplete enum Types  enum foo;, with details to follow.
5.41 Function Names as Strings  Printable strings which are the name of the current function.
5.42 Getting the Return or Frame Address of a Function  Getting the return or frame address of a function.
5.43 Other built-in functions provided by GNU CC  Other built-in functions.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Vincent Chung on June, 26 2001 using texi2html