OSDN Git Service

Upgrade to AutoGen 5 Template
[pf3gnuchains/gcc-fork.git] / gcc / extend.texi
index ed89139..6b08843 100644 (file)
@@ -1,4 +1,4 @@
-@c Copyright (C) 1988,89,92,93,94,96,98,99,2000 Free Software Foundation, Inc.
+@c Copyright (C) 1988,1989,1992,1993,1994,1996,1998,1999,2000,2001 Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
 
@@ -7,7 +7,7 @@
 @cindex extensions, C language
 @cindex C language extensions
 
-GNU C provides several language features not found in ANSI standard C.
+GNU C provides several language features not found in ISO standard C.
 (The @samp{-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
@@ -17,6 +17,13 @@ These extensions are available in C and Objective C.  Most of them are
 also available in C++.  @xref{C++ Extensions,,Extensions to the
 C++ Language}, for extensions that apply @emph{only} to C++.
 
+@c FIXME: document clearly which features are in ISO C99, but also
+@c accepted as extensions for -std=gnu89 and possibly for C++.
+@c See PR other/930.
+
+@c FIXME: the documentation for preprocessor extensions here is out of
+@c date.  See PR other/928.
+
 @c The only difference between the two versions of this menu is that the
 @c version for clear INTERNALS has an extra node, "Constraints" (which
 @c appears in a separate chapter in the other version of the manual).
@@ -36,7 +43,9 @@ C++ Language}, for extensions that apply @emph{only} to C++.
 * Hex Floats::          Hexadecimal floating-point constants.
 * Zero Length::         Zero-length arrays.
 * Variable Length::     Arrays whose length is computed at run time.
-* Macro Varargs::      Macros with variable number of arguments.
+* Variadic Macros::    Macros with a variable number of arguments.
+* Escaped Newlines::    Slightly looser rules for escaped newlines.
+* Multi-line Strings::  String literals with embedded newlines.
 * Subscripting::        Any array can be subscripted, even if not an lvalue.
 * Pointer Arith::       Arithmetic on @code{void}-pointers and function pointers.
 * Initializers::        Non-constant initializers.
@@ -47,6 +56,7 @@ C++ Language}, for extensions that apply @emph{only} to C++.
 * Case Ranges::                `case 1 ... 9' and such.
 * Function Attributes:: Declaring that functions have no side effects,
                          or that they can never return.
+* Attribute Syntax::    Formal syntax for attributes.
 * Function Prototypes:: Prototype declarations and old-style definitions.
 * C++ Comments::        C++ comments are recognized.
 * Dollar Signs::        Dollar sign is allowed in identifiers.
@@ -65,8 +75,6 @@ C++ Language}, for extensions that apply @emph{only} to C++.
                         function.
 * Return Address::      Getting the return or frame address of a function.
 * Other Builtins::      Other built-in functions.
-* Deprecated Features:: Things might disappear from g++.
-* Backwards Compatibility:: Compatibilities with earlier definitions of C++.
 @end menu
 @end ifset
 @ifclear INTERNALS
@@ -85,7 +93,9 @@ C++ Language}, for extensions that apply @emph{only} to C++.
 * Hex Floats::          Hexadecimal floating-point constants.
 * Zero Length::         Zero-length arrays.
 * Variable Length::     Arrays whose length is computed at run time.
-* Macro Varargs::      Macros with variable number of arguments.
+* Variadic Macros::    Macros with a variable number of arguments.
+* Escaped Newlines::    Slightly looser rules for escaped newlines.
+* Multi-line Strings::  String literals with embedded newlines.
 * Subscripting::        Any array can be subscripted, even if not an lvalue.
 * Pointer Arith::       Arithmetic on @code{void}-pointers and function pointers.
 * Initializers::        Non-constant initializers.
@@ -96,6 +106,7 @@ C++ Language}, for extensions that apply @emph{only} to C++.
 * Case Ranges::                `case 1 ... 9' and such.
 * Function Attributes:: Declaring that functions have no side effects,
                          or that they can never return.
+* Attribute Syntax::    Formal syntax for attributes.
 * Function Prototypes:: Prototype declarations and old-style definitions.
 * C++ Comments::        C++ comments are recognized.
 * Dollar Signs::        Dollar sign is allowed in identifiers.
@@ -114,8 +125,6 @@ C++ Language}, for extensions that apply @emph{only} to C++.
 * Function Names::     Printable strings which are the name of the current
                         function.
 * Return Address::      Getting the return or frame address of a function.
-* Deprecated Features:: Things might disappear from g++.
-* Backwards Compatibility:: Compatibilities with earlier definitions of C++.
 * Other Builtins::      Other built-in functions.
 @end menu
 @end ifclear
@@ -188,7 +197,7 @@ Statement expressions are not supported fully in G++, and their fate
 there is unclear.  (It is possible that they will become fully supported
 at some point, or that they will be deprecated, or that the bugs that
 are present will continue to exist indefinitely.)  Presently, statement
-expressions do not work well as default arguments. 
+expressions do not work well as default arguments.
 
 In addition, there are semantic issues with statement-expressions in
 C++.  If you try to use statement-expressions instead of inline
@@ -331,7 +340,7 @@ Another use of label values is in an interpreter for threaded code.
 The labels within the interpreter function can be stored in the
 threaded code for super-fast dispatching.
 
-You may not use this mechanism to jump to code in a different function. 
+You may not use this mechanism to jump to code in a different function.
 If you do that, totally unpredictable things will happen.  The best way to
 avoid this is to store the label address only in automatic variables and
 never pass it as an argument.
@@ -582,8 +591,8 @@ typeof (x[0](1))
 @end example
 
 @noindent
-This assumes that @code{x} is an array of functions; the type described
-is that of the values of the functions.
+This assumes that @code{x} is an array of pointers to functions;
+the type described is that of the values of the functions.
 
 Here is an example with a typename as the argument:
 
@@ -594,7 +603,7 @@ typeof (int *)
 @noindent
 Here the type described is that of pointers to @code{int}.
 
-If you are writing a header file that must work when included in ANSI C
+If you are writing a header file that must work when included in ISO C
 programs, write @code{__typeof__} instead of @code{typeof}.
 @xref{Alternate Keywords}.
 
@@ -868,9 +877,10 @@ extension for floating-point constants of type @code{float}.
 @cindex arrays of length zero
 @cindex zero-length arrays
 @cindex length-zero arrays
+@cindex flexible array members
 
-Zero-length arrays are allowed in GNU C.  They are very useful as the last
-element of a structure which is really a header for a variable-length
+Zero-length arrays are allowed in GNU C.  They are very useful as the
+last element of a structure which is really a header for a variable-length
 object:
 
 @example
@@ -879,31 +889,79 @@ struct line @{
   char contents[0];
 @};
 
-@{
-  struct line *thisline = (struct line *)
-    malloc (sizeof (struct line) + this_length);
-  thisline->length = this_length;
-@}
+struct line *thisline = (struct line *)
+  malloc (sizeof (struct line) + this_length);
+thisline->length = this_length;
 @end example
 
 In ISO C89, you would have to give @code{contents} a length of 1, which
 means either you waste space or complicate the argument to @code{malloc}.
 
-In ISO C99, you would use a @dfn{flexible array member}, which uses a
-slightly different syntax: leave out the @code{0} and write
-@code{contents[]}.
+In ISO C99, you would use a @dfn{flexible array member}, which is
+slightly different in syntax and semantics:
+
+@itemize @bullet
+@item
+Flexible array members are written as @code{contents[]} without
+the @code{0}.
+
+@item
+Flexible array members have incomplete type, and so the @code{sizeof}
+operator may not be applied.  As a quirk of the original implementation
+of zero-length arrays, @code{sizeof} evaluates to zero.
+
+@item
+Flexible array members may only appear as the last member of a
+@code{struct} that is otherwise non-empty.  GCC currently allows
+zero-length arrays anywhere.  You may encounter problems, however,
+defining structures containing only a zero-length array.  Such usage
+is deprecated, and we recommend using zero-length arrays only in
+places in which flexible array members would be allowed.
+@end itemize
+
+GCC versions before 3.0 allowed zero-length arrays to be statically
+initialized.  In addition to those cases that were useful, it also
+allowed initializations in situations that would corrupt later data.
+Non-empty initialization of zero-length arrays is now deprecated.
+
+Instead GCC allows static initialization of flexible array members.
+This is equivalent to defining a new structure containing the original
+structure followed by an array of sufficient size to contain the data.
+I.e. in the following, @code{f1} is constructed as if it were declared
+like @code{f2}.
+
+@example
+struct f1 @{
+  int x; int y[];
+@} f1 = @{ 1, @{ 2, 3, 4 @} @};
+
+struct f2 @{
+  struct f1 f1; int data[3];
+@} f2 = @{ @{ 1 @}, @{ 2, 3, 4 @} @};
+@end example
+
+@noindent
+The convenience of this extension is that @code{f1} has the desired
+type, eliminating the need to consistently refer to @code{f2.f1}.
+
+This has symmetry with normal static arrays, in that an array of
+unknown size is also written with @code{[]}.
 
-GCC allows static initialization of the zero-length array if
-the structure is not nested inside another structure.  I.e.
+Of course, this extension only makes sense if the extra data comes at
+the end of a top-level object, as otherwise we would be overwriting
+data at subsequent offsets.  To avoid undue complication and confusion
+with initialization of deeply nested arrays, we simply disallow any
+non-empty initialization except when the structure is the top-level
+object.  For example:
 
 @example
-/* Legal.  */
-struct line x = @{ 4, @{ 'g', 'o', 'o', 'd' @} @};
+struct foo @{ int x; int y[]; @};
+struct bar @{ struct foo z; @};
 
-/* Illegal.  */
-struct bar @{
-  struct line a;
-@} y = @{ @{ 3, @{ 'b', 'a', 'd' @} @} @};
+struct foo a = @{ 1, @{ 2, 3, 4 @} @};        // Legal.
+struct bar b = @{ @{ 1, @{ 2, 3, 4 @} @} @};    // Illegal.
+struct bar c = @{ @{ 1, @{ @} @} @};            // Legal.
+struct foo d[1] = @{ @{ 1 @{ 2, 3, 4 @} @} @};  // Illegal.
 @end example
 
 @node Variable Length
@@ -984,66 +1042,98 @@ last one must end with a semicolon, which is followed by the ``real''
 parameter declarations.  Each forward declaration must match a ``real''
 declaration in parameter name and data type.
 
-@node Macro Varargs
-@section Macros with Variable Numbers of Arguments
+@node Variadic Macros
+@section Macros with a Variable Number of Arguments.
 @cindex variable number of arguments
 @cindex macro with variable arguments
 @cindex rest argument (in macro)
+@cindex variadic macros
 
-In GNU C, a macro can accept a variable number of arguments, much as a
-function can.  The syntax for defining the macro looks much like that
-used for a function.  Here is an example:
+In the ISO C standard of 1999, a macro can be declared to accept a
+variable number of arguments much as a function can.  The syntax for
+defining the macro is similar to that of a function.  Here is an
+example:
 
 @example
-#define eprintf(format, args...)  \
- fprintf (stderr, format , ## args)
+#define debug(format, ...) fprintf (stderr, format, __VA_ARGS__)
 @end example
 
-Here @code{args} is a @dfn{rest argument}: it takes in zero or more
-arguments, as many as the call contains.  All of them plus the commas
-between them form the value of @code{args}, which is substituted into
-the macro body where @code{args} is used.  Thus, we have this expansion:
+Here @samp{@dots{}} is a @dfn{variable argument}.  In the invocation of
+such a macro, it represents the zero or more tokens until the closing
+parenthesis that ends the invocation, including any commas.  This set of
+tokens replaces the identifier @code{__VA_ARGS__} in the macro body
+wherever it appears.  See the CPP manual for more information.
+
+GCC has long supported variadic macros, and used a different syntax that
+allowed you to give a name to the variable arguments just like any other
+argument.  Here is an example:
 
 @example
-eprintf ("%s:%d: ", input_file_name, line_number)
-@expansion{}
-fprintf (stderr, "%s:%d: " , input_file_name, line_number)
+#define debug(format, args...) fprintf (stderr, format, args)
 @end example
 
-@noindent
-Note that the comma after the string constant comes from the definition
-of @code{eprintf}, whereas the last comma comes from the value of
-@code{args}.
+This is in all ways equivalent to the ISO C example above, but arguably
+more readable and descriptive.
 
-The reason for using @samp{##} is to handle the case when @code{args}
-matches no arguments at all.  In this case, @code{args} has an empty
-value.  In this case, the second comma in the definition becomes an
-embarrassment: if it got through to the expansion of the macro, we would
-get something like this:
+GNU CPP has two further variadic macro extensions, and permits them to
+be used with either of the above forms of macro definition.
+
+In standard C, you are not allowed to leave the variable argument out
+entirely; but you are allowed to pass an empty argument.  For example,
+this invocation is invalid in ISO C, because there is no comma after
+the string:
 
 @example
-fprintf (stderr, "success!\n" , )
+debug ("A message")
 @end example
 
-@noindent
-which is invalid C syntax.  @samp{##} gets rid of the comma, so we get
-the following instead:
+GNU CPP permits you to completely omit the variable arguments in this
+way.  In the above examples, the compiler would complain, though since
+the expansion of the macro still has the extra comma after the format
+string.
+
+To help solve this problem, CPP behaves specially for variable arguments
+used with the token paste operator, @samp{##}.  If instead you write
 
 @example
-fprintf (stderr, "success!\n")
+#define debug(format, ...) fprintf (stderr, format, ## __VA_ARGS__)
 @end example
 
-This is a special feature of the GNU C preprocessor: @samp{##} before a
-rest argument that is empty discards the preceding sequence of
-non-whitespace characters from the macro definition.  (If another macro
-argument precedes, none of it is discarded.)
-
-It might be better to discard the last preprocessor token instead of the
-last preceding sequence of non-whitespace characters; in fact, we may
-someday change this feature to do so.  We advise you to write the macro
-definition so that the preceding sequence of non-whitespace characters
-is just a single token, so that the meaning will not change if we change
-the definition of this feature.
+and if the variable arguments are omitted or empty, the @samp{##}
+operator causes the preprocessor to remove the comma before it.  If you
+do provide some variable arguments in your macro invocation, GNU CPP
+does not complain about the paste operation and instead places the
+variable arguments after the comma.  Just like any other pasted macro
+argument, these arguments are not macro expanded.
+
+@node Escaped Newlines
+@section Slightly Looser Rules for Escaped Newlines
+@cindex escaped newlines
+@cindex newlines (escaped)
+
+Recently, the non-traditional preprocessor has relaxed its treatment of
+escaped newlines.  Previously, the newline had to immediately follow a
+backslash.  The current implementation allows whitespace in the form of
+spaces, horizontal and vertical tabs, and form feeds between the
+backslash and the subsequent newline.  The preprocessor issues a
+warning, but treats it as a valid escaped newline and combines the two
+lines to form a single logical line.  This works within comments and
+tokens, including multi-line strings, as well as between tokens.
+Comments are @emph{not} treated as whitespace for the purposes of this
+relaxation, since they have not yet been replaced with spaces.
+
+@node Multi-line Strings
+@section String Literals with Embedded Newlines
+@cindex multi-line string literals
+
+As an extension, GNU CPP permits string literals to cross multiple lines
+without escaping the embedded newlines.  Each embedded newline is
+replaced with a single @samp{\n} character in the resulting string
+literal, regardless of what form the newline took originally.
+
+CPP currently allows such strings in directives as well (other than the
+@samp{#include} family).  This is deprecated and will eventually be
+removed.
 
 @node Subscripting
 @section Non-Lvalue Arrays May Have Subscripts
@@ -1209,6 +1299,10 @@ int widths[] = @{ [0 ... 9] = 1, [10 ... 99] = 2, [100] = 3 @};
 @end example
 
 @noindent
+If the value in it has side-effects, the side-effects will happen only once,
+not for each initialized field by the range initializer.
+
+@noindent
 Note that the length of the array is the highest value specified
 plus one.
 
@@ -1293,6 +1387,12 @@ example, with the @samp{struct point} declaration above:
 struct point ptarray[10] = @{ [2].y = yv2, [2].x = xv2, [0].x = xv0 @};
 @end example
 
+@noindent
+If the same field is initialized multiple times, it will have value from
+the last initialization.  If any such overridden initialization has
+side-effect, it is unspecified whether the side-effect happens or not.
+Currently, gcc will discard them and issue a warning.
+
 @node Case Ranges
 @section Case Ranges
 @cindex case ranges
@@ -1381,7 +1481,7 @@ hack ((union foo) x);
 @cindex functions that behave like malloc
 @cindex @code{volatile} applied to function
 @cindex @code{const} applied to function
-@cindex functions with @code{printf}, @code{scanf} or @code{strftime} style arguments
+@cindex functions with @code{printf}, @code{scanf}, @code{strftime} or @code{strfmon} style arguments
 @cindex functions that are passed arguments in registers on the 386
 @cindex functions that pop the argument stack on the 386
 @cindex functions that do not pop the argument stack on the 386
@@ -1392,11 +1492,13 @@ carefully.
 
 The keyword @code{__attribute__} allows you to specify special
 attributes when making a declaration.  This keyword is followed by an
-attribute specification inside double parentheses.  Ten attributes,
-@code{noreturn}, @code{const}, @code{format},
-@code{no_instrument_function}, @code{section}, @code{constructor},
-@code{destructor}, @code{unused}, @code{weak} and @code{malloc} are
-currently defined for functions.  Other attributes, including
+attribute specification inside double parentheses.  Fourteen attributes,
+@code{noreturn}, @code{pure}, @code{const}, @code{format},
+@code{format_arg}, @code{no_instrument_function}, @code{section},
+@code{constructor}, @code{destructor}, @code{unused}, @code{weak},
+@code{malloc}, @code{alias} and @code{no_check_memory_usage} are
+currently defined for functions.  Several other attributes are defined
+for functions on particular target systems.  Other attributes, including
 @code{section} are supported for variables declarations (@pxref{Variable
 Attributes}) and for types (@pxref{Type Attributes}).
 
@@ -1405,6 +1507,9 @@ each keyword.  This allows you to use them in header files without
 being concerned about a possible macro of the same name.  For example,
 you may use @code{__noreturn__} instead of @code{noreturn}.
 
+@xref{Attribute Syntax}, for details of the exact syntax for using
+attributes.
+
 @table @code
 @cindex @code{noreturn} function attribute
 @item noreturn
@@ -1503,8 +1608,9 @@ specifies that the @samp{const} must be attached to the return value.
 @item format (@var{archetype}, @var{string-index}, @var{first-to-check})
 @cindex @code{format} function attribute
 The @code{format} attribute specifies that a function takes @code{printf},
-@code{scanf}, or @code{strftime} style arguments which should be type-checked
-against a format string.  For example, the declaration:
+@code{scanf}, @code{strftime} or @code{strfmon} style arguments which
+should be type-checked against a format string.  For example, the
+declaration:
 
 @smallexample
 extern int
@@ -1518,8 +1624,9 @@ for consistency with the @code{printf} style format string argument
 @code{my_format}.
 
 The parameter @var{archetype} determines how the format string is
-interpreted, and should be either @code{printf}, @code{scanf}, or
-@code{strftime}.  The
+interpreted, and should be @code{printf}, @code{scanf}, @code{strftime}
+or @code{strfmon}.  (You can also use @code{__printf__},
+@code{__scanf__}, @code{__strftime__} or @code{__strfmon__}.)  The
 parameter @var{string-index} specifies which argument is the format
 string argument (starting from 1), while @var{first-to-check} is the
 number of the first argument to check against the format string.  For
@@ -1543,15 +1650,20 @@ for the standard library functions @code{printf}, @code{fprintf},
 warnings are requested (using @samp{-Wformat}), so there is no need to
 modify the header file @file{stdio.h}.  In C99 mode, the functions
 @code{snprintf}, @code{vsnprintf}, @code{vscanf}, @code{vfscanf} and
-@code{vsscanf} are also checked.
+@code{vsscanf} are also checked.  Except in strictly conforming C
+standard modes, the X/Open function @code{strfmon} is also checked.
 @xref{C Dialect Options,,Options Controlling C Dialect}.
 
 @item format_arg (@var{string-index})
 @cindex @code{format_arg} function attribute
-The @code{format_arg} attribute specifies that a function takes
-@code{printf} or @code{scanf} style arguments, modifies it (for example,
-to translate it into another language), and passes it to a @code{printf}
-or @code{scanf} style function.  For example, the declaration:
+The @code{format_arg} attribute specifies that a function takes a format
+string for a @code{printf}, @code{scanf}, @code{strftime} or
+@code{strfmon} style function and modifies it (for example, to translate
+it into another language), so the result can be passed to a
+@code{printf}, @code{scanf}, @code{strftime} or @code{strfmon} style
+function (with the remaining arguments to the format function the same
+as they would have been for the unmodified string).  For example, the
+declaration:
 
 @smallexample
 extern char *
@@ -1560,22 +1672,28 @@ my_dgettext (char *my_domain, const char *my_format)
 @end smallexample
 
 @noindent
-causes the compiler to check the arguments in calls to
-@code{my_dgettext} whose result is passed to a @code{printf},
-@code{scanf}, or @code{strftime} type function for consistency with the
-@code{printf} style format string argument @code{my_format}.
+causes the compiler to check the arguments in calls to a @code{printf},
+@code{scanf}, @code{strftime} or @code{strfmon} type function, whose
+format string argument is a call to the @code{my_dgettext} function, for
+consistency with the format string argument @code{my_format}.  If the
+@code{format_arg} attribute had not been specified, all the compiler
+could tell in such calls to format functions would be that the format
+string argument is not constant; this would generate a warning when
+@code{-Wformat-nonliteral} is used, but the calls could not be checked
+without the attribute.
 
 The parameter @var{string-index} specifies which argument is the format
 string argument (starting from 1).
 
 The @code{format-arg} attribute allows you to identify your own
 functions which modify format strings, so that GNU CC can check the
-calls to @code{printf}, @code{scanf}, or @code{strftime} function whose
-operands are a call to one of your own function.  The compiler always
-treats @code{gettext}, @code{dgettext}, and @code{dcgettext} in this
-manner except when strict ISO C support is requested by @samp{-ansi} or
-an appropriate @samp{-std} option, or @samp{-ffreestanding} is used.
-@xref{C Dialect Options,,Options Controlling C Dialect}.
+calls to @code{printf}, @code{scanf}, @code{strftime} or @code{strfmon}
+type function whose operands are a call to one of your own function.
+The compiler always treats @code{gettext}, @code{dgettext}, and
+@code{dcgettext} in this manner except when strict ISO C support is
+requested by @samp{-ansi} or an appropriate @samp{-std} option, or
+@samp{-ffreestanding} is used.  @xref{C Dialect Options,,Options
+Controlling C Dialect}.
 
 @item no_instrument_function
 @cindex @code{no_instrument_function} function attribute
@@ -1758,6 +1876,27 @@ function is an interrupt handler.  The compiler will generate function
 entry and exit sequences suitable for use in an interrupt handler when this
 attribute is present.
 
+@item interrupt
+@cindex interrupt handler functions
+Use this option on the ARM, AVR and M32R/D ports to indicate that the
+specified function is an interrupt handler.  The compiler will generate
+function entry and exit sequences suitable for use in an interrupt
+handler when this attribute is present.
+
+Note, interrupt handlers for the H8/300 and H8/300H processors can be
+specified via the @code{interrupt_handler} attribute.
+
+Note, on the AVR interrupts will be enabled inside the function.
+
+Note, for the ARM you can specify the kind of interrupt to be handled by
+adding an optional parameter to the interrupt attribute like this:
+
+@smallexample
+void f () __attribute__ ((interrupt ("IRQ")));
+@end smallexample
+
+Permissible values for this parameter are: IRQ, FIQ, SWI, ABORT and UNDEF.
+
 @item eightbit_data
 @cindex eight bit data on the H8/300 and H8/300H
 Use this option on the H8/300 and H8/300H to indicate that the specified
@@ -1777,19 +1916,6 @@ The compiler will generate more efficient code for loads and stores
 on data in the tiny data section.  Note the tiny data area is limited to
 slightly under 32kbytes of data.
 
-@item interrupt
-@cindex interrupt handlers on the M32R/D
-Use this option on the M32R/D to indicate that the specified
-function is an interrupt handler.  The compiler will generate function
-entry and exit sequences suitable for use in an interrupt handler when this
-attribute is present.
-
-Interrupt handler functions on the AVR processors
-Use this option on the AVR to indicate that the specified
-function is an interrupt handler.  The compiler will generate function
-entry and exit sequences suitable for use in an interrupt handler when this
-attribute is present. Interrupts will be enabled inside function.
-
 @item signal
 @cindex signal handler functions on the AVR processors
 Use this option on the AVR to indicate that the specified
@@ -1798,10 +1924,10 @@ entry and exit sequences suitable for use in an signal handler when this
 attribute is present. Interrupts will be disabled inside function.
 
 @item naked
-@cindex function without a prologue/epilogue code on the AVR processors
-Use this option on the AVR to indicate that the specified
-function don't have a prologue/epilogue.  The compiler don't generate
-function entry and exit sequences.
+@cindex function without a prologue/epilogue code
+Use this option on the ARM or AVR ports to indicate that the specified
+function do not need prologue/epilogue sequences generated by the
+compiler.  It is up to the programmer to provide these sequences.
 
 @item model (@var{model-name})
 @cindex function addressability on the M32R/D
@@ -1814,11 +1940,11 @@ Small model objects live in the lower 16MB of memory (so that their
 addresses can be loaded with the @code{ld24} instruction), and are
 callable with the @code{bl} instruction.
 
-Medium model objects may live anywhere in the 32 bit address space (the
+Medium model objects may live anywhere in the 32-bit address space (the
 compiler will generate @code{seth/add3} instructions to load their addresses),
 and are callable with the @code{bl} instruction.
 
-Large model objects may live anywhere in the 32 bit address space (the
+Large model objects may live anywhere in the 32-bit address space (the
 compiler will generate @code{seth/add3} instructions to load their addresses),
 and may not be reachable with the @code{bl} instruction (the compiler will
 generate the much slower @code{seth/add3/jl} instruction sequence).
@@ -1831,9 +1957,10 @@ attribute declaration with another attribute declaration.
 
 @cindex @code{#pragma}, reason for not using
 @cindex pragma, reason for not using
-Some people object to the @code{__attribute__} feature, suggesting that ANSI C's
-@code{#pragma} should be used instead.  There are two reasons for not
-doing this.
+Some people object to the @code{__attribute__} feature, suggesting that
+ISO C's @code{#pragma} should be used instead.  At the time
+@code{__attribute__} was designed, there were two reasons for not doing
+this.
 
 @enumerate
 @item
@@ -1844,9 +1971,193 @@ There is no telling what the same @code{#pragma} might mean in another
 compiler.
 @end enumerate
 
-These two reasons apply to almost any application that might be proposed
-for @code{#pragma}.  It is basically a mistake to use @code{#pragma} for
-@emph{anything}.
+These two reasons applied to almost any application that might have been
+proposed for @code{#pragma}.  It was basically a mistake to use
+@code{#pragma} for @emph{anything}.
+
+The ISO C99 standard includes @code{_Pragma}, which now allows pragmas
+to be generated from macros.  In addition, a @code{#pragma GCC}
+namespace is now in use for GCC-specific pragmas.  However, it has been
+found convenient to use @code{__attribute__} to achieve a natural
+attachment of attributes to their corresponding declarations, whereas
+@code{#pragma GCC} is of use for constructs that do not naturally form
+part of the grammar.  @xref{Other Directives,,Miscellaneous
+Preprocessing Directives, cpp, The C Preprocessor}.
+
+@node Attribute Syntax
+@section Attribute Syntax
+@cindex attribute syntax
+
+This section describes the syntax with which @code{__attribute__} may be
+used, and the constructs to which attribute specifiers bind, for the C
+language.  Some details may vary for C++ and Objective C.  Because of
+infelicities in the grammar for attributes, some forms described here
+may not be successfully parsed in all cases.
+
+@xref{Function Attributes}, for details of the semantics of attributes
+applying to functions.  @xref{Variable Attributes}, for details of the
+semantics of attributes applying to variables.  @xref{Type Attributes},
+for details of the semantics of attributes applying to structure, union
+and enumerated types.
+
+An @dfn{attribute specifier} is of the form
+@code{__attribute__ ((@var{attribute-list}))}.  An @dfn{attribute list}
+is a possibly empty comma-separated sequence of @dfn{attributes}, where
+each attribute is one of the following:
+
+@itemize @bullet
+@item
+Empty.  Empty attributes are ignored.
+
+@item
+A word (which may be an identifier such as @code{unused}, or a reserved
+word such as @code{const}).
+
+@item
+A word, followed by, in parentheses, parameters for the attribute.
+These parameters take one of the following forms:
+
+@itemize @bullet
+@item
+An identifier.  For example, @code{mode} attributes use this form.
+
+@item
+An identifier followed by a comma and a non-empty comma-separated list
+of expressions.  For example, @code{format} attributes use this form.
+
+@item
+A possibly empty comma-separated list of expressions.  For example,
+@code{format_arg} attributes use this form with the list being a single
+integer constant expression, and @code{alias} attributes use this form
+with the list being a single string constant.
+@end itemize
+@end itemize
+
+An @dfn{attribute specifier list} is a sequence of one or more attribute
+specifiers, not separated by any other tokens.
+
+An attribute specifier list may appear after the colon following a
+label, other than a @code{case} or @code{default} label.  The only
+attribute it makes sense to use after a label is @code{unused}.  This
+feature is intended for code generated by programs which contains labels
+that may be unused but which is compiled with @option{-Wall}.  It would
+not normally be appropriate to use in it human-written code, though it
+could be useful in cases where the code that jumps to the label is
+contained within an @code{#ifdef} conditional.
+
+An attribute specifier list may appear as part of a @code{struct},
+@code{union} or @code{enum} specifier.  It may go either immediately
+after the @code{struct}, @code{union} or @code{enum} keyword, or after
+the closing brace.  It is ignored if the content of the structure, union
+or enumerated type is not defined in the specifier in which the
+attribute specifier list is used---that is, in usages such as
+@code{struct __attribute__((foo)) bar} with no following opening brace.
+Where attribute specifiers follow the closing brace, they are considered
+to relate to the structure, union or enumerated type defined, not to any
+enclosing declaration the type specifier appears in, and the type
+defined is not complete until after the attribute specifiers.
+@c Otherwise, there would be the following problems: a shift/reduce
+@c conflict between attributes binding the the struct/union/enum and
+@c binding to the list of specifiers/qualifiers; and "aligned"
+@c attributes could use sizeof for the structure, but the size could be
+@c changed later by "packed" attributes.
+
+Otherwise, an attribute specifier appears as part of a declaration,
+counting declarations of unnamed parameters and type names, and relates
+to that declaration (which may be nested in another declaration, for
+example in the case of a parameter declaration).  In future, attribute
+specifiers in some places may however apply to a particular declarator
+within a declaration instead; these cases are noted below.
+
+Any list of specifiers and qualifiers at the start of a declaration may
+contain attribute specifiers, whether or not such a list may in that
+context contain storage class specifiers.  (Some attributes, however,
+are essentially in the nature of storage class specifiers, and only make
+sense where storage class specifiers may be used; for example,
+@code{section}.)  There is one necessary limitation to this syntax: the
+first old-style parameter declaration in a function definition cannot
+begin with an attribute specifier, because such an attribute applies to
+the function instead by syntax described below (which, however, is not
+yet implemented in this case).  In some other cases, attribute
+specifiers are permitted by this grammar but not yet supported by the
+compiler.  All attribute specifiers in this place relate to the
+declaration as a whole.  In the obsolencent usage where a type of
+@code{int} is implied by the absence of type specifiers, such a list of
+specifiers and qualifiers may be an attribute specifier list with no
+other specifiers or qualifiers.
+
+An attribute specifier list may appear immediately before a declarator
+(other than the first) in a comma-separated list of declarators in a
+declaration of more than one identifier using a single list of
+specifiers and qualifiers.  At present, such attribute specifiers apply
+not only to the identifier before whose declarator they appear, but to
+all subsequent identifiers declared in that declaration, but in future
+they may apply only to that single identifier.  For example, in
+@code{__attribute__((noreturn)) void d0 (void),
+__attribute__((format(printf, 1, 2))) d1 (const char *, ...), d2
+(void)}, the @code{noreturn} attribute applies to all the functions
+declared; the @code{format} attribute should only apply to @code{d1},
+but at present applies to @code{d2} as well (and so causes an error).
+
+An attribute specifier list may appear immediately before the comma,
+@code{=} or semicolon terminating the declaration of an identifier other
+than a function definition.  At present, such attribute specifiers apply
+to the declared object or function, but in future they may attach to the
+outermost adjacent declarator.  In simple cases there is no difference,
+but, for example, in @code{void (****f)(void)
+__attribute__((noreturn));}, at present the @code{noreturn} attribute
+applies to @code{f}, which causes a warning since @code{f} is not a
+function, but in future it may apply to the function @code{****f}.  The
+precise semantics of what attributes in such cases will apply to are not
+yet specified.  Where an assembler name for an object or function is
+specified (@pxref{Asm Labels}), at present the attribute must follow the
+@code{asm} specification; in future, attributes before the @code{asm}
+specification may apply to the adjacent declarator, and those after it
+to the declared object or function.
+
+An attribute specifier list may, in future, be permitted to appear after
+the declarator in a function definition (before any old-style parameter
+declarations or the function body).
+
+An attribute specifier list may appear at the start of a nested
+declarator.  At present, there are some limitations in this usage: the
+attributes apply to the identifer declared, and to all subsequent
+identifiers declared in that declaration (if it includes a
+comma-separated list of declarators), rather than to a specific
+declarator.  When attribute specifiers follow the @code{*} of a pointer
+declarator, they must presently follow any type qualifiers present, and
+cannot be mixed with them.  The following describes intended future
+semantics which make this syntax more useful only.  It will make the
+most sense if you are familiar with the formal specification of
+declarators in the ISO C standard.
+
+Consider (as in C99 subclause 6.7.5 paragraph 4) a declaration @code{T
+D1}, where @code{T} contains declaration specifiers that specify a type
+@var{Type} (such as @code{int}) and @code{D1} is a declarator that
+contains an identifier @var{ident}.  The type specified for @var{ident}
+for derived declarators whose type does not include an attribute
+specifier is as in the ISO C standard.
+
+If @code{D1} has the form @code{( @var{attribute-specifier-list} D )},
+and the declaration @code{T D} specifies the type
+``@var{derived-declarator-type-list} @var{Type}'' for @var{ident}, then
+@code{T D1} specifies the type ``@var{derived-declarator-type-list}
+@var{attribute-specifier-list} @var{Type}'' for @var{ident}.
+
+If @code{D1} has the form @code{*
+@var{type-qualifier-and-attribute-specifier-list} D}, and the
+declaration @code{T D} specifies the type
+``@var{derived-declarator-type-list} @var{Type}'' for @var{ident}, then
+@code{T D1} specifies the type ``@var{derived-declarator-type-list}
+@var{type-qualifier-and-attribute-specifier-list} @var{Type}'' for
+@var{ident}.
+
+For example, @code{void (__attribute__((noreturn)) ****f)();} specifies
+the type ``pointer to pointer to pointer to pointer to non-returning
+function returning @code{void}''.  As another example, @code{char
+*__attribute__((aligned(8))) *f;} specifies the type ``pointer to
+8-byte-aligned pointer to @code{char}''.  Note again that this describes
+intended future semantics, not current implementation.
 
 @node Function Prototypes
 @section Prototypes and Old-Style Function Definitions
@@ -1854,7 +2165,7 @@ for @code{#pragma}.  It is basically a mistake to use @code{#pragma} for
 @cindex old-style function definitions
 @cindex promotion of formal parameters
 
-GNU C extends ANSI C to allow a function prototype to override a later
+GNU C extends ISO C to allow a function prototype to override a later
 old-style non-prototype definition.  Consider the following example:
 
 @example
@@ -1877,13 +2188,13 @@ isroot (x)   /* ??? lossage here ??? */
 @}
 @end example
 
-Suppose the type @code{uid_t} happens to be @code{short}.  ANSI C does
+Suppose the type @code{uid_t} happens to be @code{short}.  ISO C does
 not allow this example, because subword arguments in old-style
 non-prototype definitions are promoted.  Therefore in this example the
 function definition's argument is really an @code{int}, which does not
 match the prototype argument type of @code{short}.
 
-This restriction of ANSI C makes it hard to write code that is portable
+This restriction of ISO C makes it hard to write code that is portable
 to traditional C compilers, because the programmer does not know
 whether the @code{uid_t} type is @code{short}, @code{int}, or
 @code{long}.  Therefore, in cases like these GNU C allows a prototype
@@ -1916,7 +2227,8 @@ In GNU C, you may use C++ style comments, which start with @samp{//} and
 continue until the end of the line.  Many other C implementations allow
 such comments, and they are likely to be in a future C standard.
 However, C++ style comments are not recognized if you specify
-@w{@samp{-ansi}} or @w{@samp{-traditional}}, since they are incompatible
+@w{@samp{-ansi}}, a @option{-std} option specifying a version of ISO C
+before C99, or @w{@samp{-traditional}}, since they are incompatible
 with traditional constructs like @code{dividend//*comment*/divisor}.
 
 @node Dollar Signs
@@ -1986,15 +2298,20 @@ attributes of variables or structure fields.  This keyword is followed
 by an attribute specification inside double parentheses.  Eight
 attributes are currently defined for variables: @code{aligned},
 @code{mode}, @code{nocommon}, @code{packed}, @code{section},
-@code{transparent_union}, @code{unused}, and @code{weak}.  Other
+@code{transparent_union}, @code{unused}, and @code{weak}.  Some other
+attributes are defined for variables on particular target systems.  Other
 attributes are available for functions (@pxref{Function Attributes}) and
-for types (@pxref{Type Attributes}).
+for types (@pxref{Type Attributes}).  Other front-ends might define more
+attributes (@pxref{C++ Extensions,,Extensions to the C++ Language}).
 
 You may also specify attributes with @samp{__} preceding and following
 each keyword.  This allows you to use them in header files without
 being concerned about a possible macro of the same name.  For example,
 you may use @code{__aligned__} instead of @code{aligned}.
 
+@xref{Attribute Syntax}, for details of the exact syntax for using
+attributes.
+
 @table @code
 @cindex @code{aligned} attribute
 @item aligned (@var{alignment})
@@ -2148,10 +2465,10 @@ section, consider using the facilities of the linker instead.
 
 @item shared
 @cindex @code{shared} variable attribute
-On Windows NT, in addition to putting variable definitions in a named 
-section, the section can also be shared among all running copies of an 
-executable or DLL. For example, this small program defines shared data 
-by putting it in a named section "shared" and marking the section 
+On Windows NT, in addition to putting variable definitions in a named
+section, the section can also be shared among all running copies of an
+executable or DLL. For example, this small program defines shared data
+by putting it in a named section "shared" and marking the section
 shareable:
 
 @smallexample
@@ -2167,7 +2484,7 @@ main()
 
 @noindent
 You may only use the @code{shared} attribute along with @code{section}
-attribute with a fully initialized global definition because of the way 
+attribute with a fully initialized global definition because of the way
 linkers work.  See @code{section} attribute for more information.
 
 The @code{shared} attribute is only available on Windows NT.
@@ -2197,7 +2514,7 @@ or @code{large}, representing each of the code models.
 Small model objects live in the lower 16MB of memory (so that their
 addresses can be loaded with the @code{ld24} instruction).
 
-Medium and large model objects may live anywhere in the 32 bit address space
+Medium and large model objects may live anywhere in the 32-bit address space
 (the compiler will generate @code{seth/add3} instructions to load their
 addresses).
 
@@ -2215,9 +2532,9 @@ packed))}.
 The keyword @code{__attribute__} allows you to specify special
 attributes of @code{struct} and @code{union} types when you define such
 types.  This keyword is followed by an attribute specification inside
-double parentheses.  Three attributes are currently defined for types:
-@code{aligned}, @code{packed}, and @code{transparent_union}.  Other
-attributes are defined for functions (@pxref{Function Attributes}) and
+double parentheses.  Four attributes are currently defined for types:
+@code{aligned}, @code{packed}, @code{transparent_union}, and @code{unused}.
+Other attributes are defined for functions (@pxref{Function Attributes}) and
 for variables (@pxref{Variable Attributes}).
 
 You may also specify any one of these attributes with @samp{__}
@@ -2235,6 +2552,9 @@ brace of a definition.
 You may also specify attributes between the enum, struct or union
 tag and the name of the type rather than after the closing brace.
 
+@xref{Attribute Syntax}, for details of the exact syntax for using
+attributes.
+
 @table @code
 @cindex @code{aligned} attribute
 @item aligned (@var{alignment})
@@ -2256,7 +2576,7 @@ store) instructions when copying one variable of type @code{struct S} to
 another, thus improving run-time efficiency.
 
 Note that the alignment of any given @code{struct} or @code{union} type
-is required by the ANSI C standard to be at least a perfect multiple of
+is required by the ISO C standard to be at least a perfect multiple of
 the lowest common multiple of the alignments of all of the members of
 the @code{struct} or @code{union} in question.  This means that you @emph{can}
 effectively adjust the alignment of a @code{struct} or @code{union}
@@ -2432,10 +2752,10 @@ inc (int *a)
 @}
 @end example
 
-(If you are writing a header file to be included in ANSI C programs, write
+(If you are writing a header file to be included in ISO C programs, write
 @code{__inline__} instead of @code{inline}.  @xref{Alternate Keywords}.)
 You can also make all ``simple enough'' functions inline with the option
-@samp{-finline-functions}. 
+@samp{-finline-functions}.
 
 Note that certain usages in a function definition can make it unsuitable
 for inline substitution.  Among these usages are: use of varargs, use of
@@ -2639,17 +2959,20 @@ inputs or outputs of the @code{asm}, as the @samp{memory} clobber does
 not count as a side-effect of the @code{asm}.
 
 You can put multiple assembler instructions together in a single
-@code{asm} template, separated either with newlines (written as
-@samp{\n}) or with semicolons if the assembler allows such semicolons.
-The GNU assembler allows semicolons and most Unix assemblers seem to do
-so.  The input operands are guaranteed not to use any of the clobbered
+@code{asm} template, separated by the characters normally used in assembly
+code for the system.  A combination that works in most places is a newline
+to break the line, plus a tab character to move to the instruction field
+(written as @samp{\n\t}).  Sometimes semicolons can be used, if the
+assembler allows semicolons as a line-breaking character.  Note that some
+assembler dialects use semicolons to start a comment.
+The input operands are guaranteed not to use any of the clobbered
 registers, and neither will the output operands' addresses, so you can
 read and write the clobbered registers as many times as you like.  Here
 is an example of multiple instructions in a template; it assumes the
 subroutine @code{_foo} accepts arguments in registers 9 and 10:
 
 @example
-asm ("movl %0,r9;movl %1,r10;call _foo"
+asm ("movl %0,r9\n\tmovl %1,r10\n\tcall _foo"
      : /* no outputs */
      : "g" (from), "g" (to)
      : "r9", "r10");
@@ -2667,7 +2990,7 @@ instruction, you must include a branch and a label in the @code{asm}
 construct, as follows:
 
 @example
-asm ("clr %0;frob %1;beq 0f;mov #1,%0;0:"
+asm ("clr %0\n\tfrob %1\n\tbeq 0f\n\tmov #1,%0\n0:"
      : "g" (result)
      : "g" (input));
 @end example
@@ -2729,23 +3052,38 @@ the @code{asm}.  For example:
 @noindent
 If you write an @code{asm} instruction with no outputs, GNU CC will know
 the instruction has side-effects and will not delete the instruction or
-move it outside of loops.  If the side-effects of your instruction are
-not purely external, but will affect variables in your program in ways
-other than reading the inputs and clobbering the specified registers or
-memory, you should write the @code{volatile} keyword to prevent future
-versions of GNU CC from moving the instruction around within a core
-region.
-
-An @code{asm} instruction without any operands or clobbers (and ``old
-style'' @code{asm}) will not be deleted or moved significantly,
-regardless, unless it is unreachable, the same way as if you had
-written a @code{volatile} keyword.
+move it outside of loops.
+
+The @code{volatile} keyword indicates that the instruction has
+important side-effects.  GCC will not delete a volatile @code{asm} if
+it is reachable.  (The instruction can still be deleted if GCC can
+prove that control-flow will never reach the location of the
+instruction.)  In addition, GCC will not reschedule instructions
+across a volatile @code{asm} instruction.  For example:
+
+@example
+*(volatile int *)addr = foo;
+asm volatile ("eieio" : : );
+@end example
+
+@noindent 
+Assume @code{addr} contains the address of a memory mapped device
+register.  The PowerPC @code{eieio} instruction (Enforce In-order
+Execution of I/O) tells the cpu to make sure that the store to that
+device register happens before it issues any other I/O.
 
 Note that even a volatile @code{asm} instruction can be moved in ways
 that appear insignificant to the compiler, such as across jump
 instructions.  You can't expect a sequence of volatile @code{asm}
 instructions to remain perfectly consecutive.  If you want consecutive
-output, use a single @code{asm}.
+output, use a single @code{asm}.  Also, GCC will perform some
+optimizations across a volatile @code{asm} instruction; GCC does not
+``forget everything'' when it encounters a volatile @code{asm}
+instruction the way some other compilers do.
+
+An @code{asm} instruction without any operands or clobbers (an ``old
+style'' @code{asm}) will be treated identically to a volatile
+@code{asm} instruction.
 
 It is a natural idea to look for a way to give access to the condition
 code left by the assembler instruction.  However, when we attempted to
@@ -2760,7 +3098,7 @@ For reasons similar to those described above, it is not possible to give
 an assembler instruction access to the condition code left by previous
 instructions.
 
-If you are writing a header file that should be includable in ANSI C
+If you are writing a header file that should be includable in ISO C
 programs, write @code{__asm__} instead of @code{asm}.  @xref{Alternate
 Keywords}.
 
@@ -3085,15 +3423,20 @@ be deleted or moved or simplified.
 @cindex alternate keywords
 @cindex keywords, alternate
 
-The option @samp{-traditional} disables certain keywords; @samp{-ansi}
-disables certain others.  This causes trouble when you want to use GNU C
-extensions, or ANSI C features, in a general-purpose header file that
-should be usable by all programs, including ANSI C programs and traditional
-ones.  The keywords @code{asm}, @code{typeof} and @code{inline} cannot be
-used since they won't work in a program compiled with @samp{-ansi}, while
-the keywords @code{const}, @code{volatile}, @code{signed}, @code{typeof}
-and @code{inline} won't work in a program compiled with
-@samp{-traditional}.@refill
+The option @option{-traditional} disables certain keywords;
+@option{-ansi} and the various @option{-std} options disable certain
+others.  This causes trouble when you want to use GNU C extensions, or
+ISO C features, in a general-purpose header file that should be usable
+by all programs, including ISO C programs and traditional ones.  The
+keywords @code{asm}, @code{typeof} and @code{inline} cannot be used
+since they won't work in a program compiled with @option{-ansi}
+(although @code{inline} can be used in a program compiled with
+@option{-std=c99}), while the keywords @code{const}, @code{volatile},
+@code{signed}, @code{typeof} and @code{inline} won't work in a program
+compiled with @option{-traditional}.  The ISO C99 keyword
+@code{restrict} is only available when @option{-std=gnu99} (which will
+eventually be the default) or @option{-std=c99} (or the equivalent
+@option{-std=iso9899:1999}) is used.@refill
 
 The way to solve these problems is to put @samp{__} at the beginning and
 end of each problematical keyword.  For example, use @code{__asm__}
@@ -3273,16 +3616,28 @@ function as well.
 @findex alloca
 @findex bcmp
 @findex bzero
+@findex cimag
+@findex cimagf
+@findex cimagl
+@findex conj
+@findex conjf
+@findex conjl
 @findex cos
 @findex cosf
 @findex cosl
+@findex creal
+@findex crealf
+@findex creall
 @findex exit
 @findex _exit
+@findex _Exit
 @findex fabs
 @findex fabsf
 @findex fabsl
 @findex ffs
+@findex fprintf
 @findex fputs
+@findex imaxabs
 @findex index
 @findex labs
 @findex llabs
@@ -3297,14 +3652,18 @@ function as well.
 @findex sqrt
 @findex sqrtf
 @findex sqrtl
+@findex strcat
 @findex strchr
 @findex strcmp
 @findex strcpy
+@findex strcspn
 @findex strlen
+@findex strncat
 @findex strncmp
 @findex strncpy
 @findex strpbrk
 @findex strrchr
+@findex strspn
 @findex strstr
 
 GNU CC provides a large number of built-in functions other than the ones
@@ -3323,10 +3682,11 @@ option.  Many of these functions are only optimized in certain cases; if
 not optimized in a particular case, a call to the library function will
 be emitted.
 
-The functions @code{abort}, @code{exit}, and @code{_exit} are recognized
-and presumed not to return, but otherwise are not built in.
-@code{_exit} is not recognized in strict ISO C mode (@samp{-ansi},
-@samp{-std=c89} or @samp{-std=c99}).
+The functions @code{abort}, @code{exit}, @code{_Exit} and @code{_exit}
+are recognized and presumed not to return, but otherwise are not built
+in.  @code{_exit} is not recognized in strict ISO C mode (@samp{-ansi},
+@samp{-std=c89} or @samp{-std=c99}).  @code{_Exit} is not recognized in
+strict C89 mode (@samp{-ansi} or @samp{-std=c89}).
 
 Outside strict ISO C mode, the functions @code{alloca}, @code{bcmp},
 @code{bzero}, @code{index}, @code{rindex} and @code{ffs} may be handled
@@ -3335,8 +3695,10 @@ as builtins.  Corresponding versions @code{__builtin_alloca},
 @code{__builtin_rindex} and @code{__builtin_ffs} are also recognized in
 strict ISO C mode.
 
-The ISO C99 function @code{llabs} is handled as a builtin except in
-strict ISO C89 mode.  There are also builtin versions of the ISO C99
+The ISO C99 functions @code{conj}, @code{conjf}, @code{conjl},
+@code{creal}, @code{crealf}, @code{creall}, @code{cimag}, @code{cimagf},
+@code{cimagl}, @code{llabs} and @code{imaxabs} are handled as builtins
+except in strict ISO C89 mode.  There are also builtin versions of the ISO C99
 functions @code{cosf}, @code{cosl}, @code{fabsf}, @code{fabsl},
 @code{sinf}, @code{sinl}, @code{sqrtf}, and @code{sqrtl}, that are
 recognized in any mode since ISO C89 reserves these names for the
@@ -3345,12 +3707,13 @@ corresponding versions prefixed with @code{__builtin_}.
 
 The following ISO C89 functions are recognized as builtins unless
 @samp{-fno-builtin} is specified: @code{abs}, @code{cos}, @code{fabs},
-@code{fputs}, @code{labs}, @code{memcmp}, @code{memcpy}, @code{memset},
-@code{printf}, @code{sin}, @code{sqrt}, @code{strchr}, @code{strcmp},
-@code{strcpy}, @code{strlen}, @code{strncmp}, @code{strncpy},
-@code{strpbrk}, @code{strrchr}, and @code{strstr}.  All of these
-functions have corresponding versions prefixed with @code{__builtin_},
-except that the version for @code{sqrt} is called
+@code{fprintf}, @code{fputs}, @code{labs}, @code{memcmp}, @code{memcpy},
+@code{memset}, @code{printf}, @code{sin}, @code{sqrt}, @code{strcat},
+@code{strchr}, @code{strcmp}, @code{strcpy}, @code{strcspn},
+@code{strlen}, @code{strncat}, @code{strncmp}, @code{strncpy},
+@code{strpbrk}, @code{strrchr}, @code{strspn}, and @code{strstr}.  All
+of these functions have corresponding versions prefixed with
+@code{__builtin_}, except that the version for @code{sqrt} is called
 @code{__builtin_fsqrt}.
 
 GNU CC provides builtin versions of the ISO C99 floating point
@@ -3393,7 +3756,7 @@ specify the @samp{-O} option.
 
 @findex __builtin_expect
 @item __builtin_expect(@var{exp}, @var{c})
-You may use @code{__builtin_expect} to provide the compiler with 
+You may use @code{__builtin_expect} to provide the compiler with
 branch prediction information.  In general, you should prefer to
 use actual profile feedback for this (@samp{-fprofile-arcs}), as
 programmers are notoriously bad at predicting how their programs
@@ -3424,68 +3787,6 @@ if (__builtin_expect (ptr != NULL, 1))
 when testing pointer or floating-point values.
 @end table
 
-@node Deprecated Features
-@section Deprecated Features
-
-In the past, the GNU C++ compiler was extended to experiment with new
-features, at a time when the C++ language was still evolving. Now that
-the C++ standard is complete, some of those features are superseded by
-superior alternatives. Using the old features might cause a warning in
-some cases that the feature will be dropped in the future. In other
-cases, the feature might be gone already.
-
-While the list below is not exhaustive, it documents some of the options
-that are now deprecated:
-
-@table @code
-@item -fexternal-templates
-@itemx -falt-external-templates
-These are two of the many ways for g++ to implement template
-instantiation. @xref{Template Instantiation}. The C++ standard clearly
-defines how template definitions have to be organized across
-implementation units. g++ has an implicit instantiation mechanism that
-should work just fine for standard-conforming code.
-
-@item -fstrict-prototype
-@itemx -fno-strict-prototype
-Previously it was possible to use an empty prototype parameter list to
-indicate an unspecified number of parameters (like C), rather than no
-parameters, as C++ demands. This feature has been removed, except where
-it is required for backwards compatibility @xref{Backwards Compatibility}.
-@end table
-
-The named return value extension has been deprecated, and will be
-removed from g++ at some point.
-
-@node Backwards Compatibility
-@section Backwards Compatibility
-@cindex Backwards Compatibility
-@cindex ARM
-
-Now that there is a definitive ISO standard C++, g++ has a specification
-to adhere to. The C++ language evolved over time, and features that used
-to be acceptable in previous drafts of the standard, such as the ARM, are
-no longer accepted. In order to allow compilation of C++ written to such
-drafts, g++ contains some backwards compatibilities. @emph{All such
-backwards compatibility features are liable to disappear in future
-versions of g++.} They should be considered deprecated @xref{Deprecated
-Features}.
-
-@table @code
-@item For scope
-If a variable is declared at for scope, it used to remain in scope until
-the end of the scope which contained the for statement (rather than just
-within the for scope). g++ retains this, but issues a warning, if such a
-variable is accessed outside the for scope.
-
-@item implicit C language
-Old C system header files did not contain an @code{extern "C" @{...@}}
-scope to set the language. On such systems, all header files are
-implicitly scoped inside a C language scope. Also, an empty prototype
-@code{()} will be treated as an unspecified number of arguments, rather
-than no arguments, as C++ demands.
-@end table
-
 @node C++ Extensions
 @chapter Extensions to the C++ Language
 @cindex extensions, C++ language
@@ -3504,11 +3805,15 @@ Predefined Macros,cpp.info,The C Preprocessor}).
 * Volatiles::          What constitutes an access to a volatile object.
 * Restricted Pointers:: C99 restricted pointers and references.
 * C++ Interface::       You can use a single C++ header file for both
-                         declarations and definitions.
+                        declarations and definitions.
 * Template Instantiation:: Methods for ensuring that exactly one copy of
-                         each needed template instantiation is emitted.
+                        each needed template instantiation is emitted.
 * Bound member functions:: You can extract a function pointer to the
                         method denoted by a @samp{->*} or @samp{.*} expression.
+* C++ Attributes::      Variable, function, and type attributes for C++ only.
+* Java Exceptions::     Tweaking exception handling to work with Java.
+* Deprecated Features:: Things might disappear from g++.
+* Backwards Compatibility:: Compatibilities with earlier definitions of C++.
 @end menu
 
 @node Min and Max
@@ -4018,3 +4323,160 @@ fptr p1 = (fptr)(&A::foo);
 
 You must specify @samp{-Wno-pmf-conversions} to use this extension.
 
+@node C++ Attributes
+@section C++-Specific Variable, Function, and Type Attributes
+
+Some attributes only make sense for C++ programs.
+
+@table @code
+@item init_priority (@var{priority})
+@cindex init_priority attribute
+
+
+In Standard C++, objects defined at namespace scope are guaranteed to be
+initialized in an order in strict accordance with that of their definitions
+@emph{in a given translation unit}.  No guarantee is made for initializations
+across translation units.  However, GNU C++ allows users to control the
+order of initialization of objects defined at namespace scope with the
+@code{init_priority} attribute by specifying a relative @var{priority},
+a constant integral expression currently bounded between 101 and 65535
+inclusive.  Lower numbers indicate a higher priority.
+
+In the following example, @code{A} would normally be created before
+@code{B}, but the @code{init_priority} attribute has reversed that order:
+
+@example
+Some_Class  A  __attribute__ ((init_priority (2000)));
+Some_Class  B  __attribute__ ((init_priority (543)));
+@end example
+
+@noindent
+Note that the particular values of @var{priority} do not matter; only their
+relative ordering.
+
+
+@item com_interface
+@cindex com_interface attribute
+
+@c This is based on:  1) grepping the code,
+@c 2) http://gcc.gnu.org/ml/gcc-bugs/1999-08n/msg01212.html
+@c 3) http://gcc.gnu.org/ml/gcc-bugs/1999-08n/msg01215.html
+@c and 4) a lot of guesswork.  You can tell I don't use COM.  -pme 21Dec00
+
+This type attribute takes no parameters, and marks a class or struct as an
+interface for communication via COM; the class will support the COM ABI
+rather than the full C++ ABI.  Currently this means that RTTI is not possible
+with the resulting class heirarchy.  The virtual pointer table will be
+changed to be COM-compliant.  Also, all classes and structs derived from one
+marked with this attribute are implicitly marked with the same attribute;
+thus, only the base class in a COM hierarchy needs @code{com_interface}.
+
+@item java_interface
+@cindex java_interface attribute
+
+This type attribute informs C++ that the class is a Java interface.  It may
+only be applied to classes declared within an @code{extern "Java"} block.
+Calls to methods declared in this interface will be dispatched using GCJ's
+interface table mechanism, instead of regular virtual table dispatch.
+
+@end table
+
+@node Java Exceptions
+@section Java Exceptions
+
+The Java language uses a slightly different exception handling model
+from C++.  Normally, GNU C++ will automatically detect when you are
+writing C++ code that uses Java exceptions, and handle them
+appropriately.  However, if C++ code only needs to execute destructors
+when Java exceptions are thrown through it, GCC will guess incorrectly.
+Sample problematic code:
+
+@example
+  struct S @{ ~S(); @};
+  extern void bar();    // is implemented in Java and may throw exceptions
+  void foo()
+  @{
+    S s;
+    bar();
+  @}
+@end example
+
+@noindent
+The usual effect of an incorrect guess is a link failure, complaining of
+a missing routine called @samp{__gxx_personality_v0}.
+
+You can inform the compiler that Java exceptions are to be used in a
+translation unit, irrespective of what it might think, by writing
+@samp{@w{#pragma GCC java_exceptions}} at the head of the file.  This
+@samp{#pragma} must appear before any functions that throw or catch
+exceptions, or run destructors when exceptions are thrown through them.
+
+You cannot mix Java and C++ exceptions in the same translation unit.  It
+is believed to be safe to throw a C++ exception from one file through
+another file compiled for the for the Java exception model, or vice
+versa, but there may be bugs in this area.
+
+@node Deprecated Features
+@section Deprecated Features
+
+In the past, the GNU C++ compiler was extended to experiment with new
+features, at a time when the C++ language was still evolving. Now that
+the C++ standard is complete, some of those features are superseded by
+superior alternatives. Using the old features might cause a warning in
+some cases that the feature will be dropped in the future. In other
+cases, the feature might be gone already.
+
+While the list below is not exhaustive, it documents some of the options
+that are now deprecated:
+
+@table @code
+@item -fexternal-templates
+@itemx -falt-external-templates
+These are two of the many ways for g++ to implement template
+instantiation. @xref{Template Instantiation}. The C++ standard clearly
+defines how template definitions have to be organized across
+implementation units. g++ has an implicit instantiation mechanism that
+should work just fine for standard-conforming code.
+
+@item -fstrict-prototype
+@itemx -fno-strict-prototype
+Previously it was possible to use an empty prototype parameter list to
+indicate an unspecified number of parameters (like C), rather than no
+parameters, as C++ demands. This feature has been removed, except where
+it is required for backwards compatibility @xref{Backwards Compatibility}.
+@end table
+
+The named return value extension has been deprecated, and will be
+removed from g++ at some point.
+
+The use of initializer lists with new expressions has been deprecated,
+and will be removed from g++ at some point.
+
+@node Backwards Compatibility
+@section Backwards Compatibility
+@cindex Backwards Compatibility
+@cindex ARM [Annotated C++ Reference Manual]
+
+Now that there is a definitive ISO standard C++, g++ has a specification
+to adhere to. The C++ language evolved over time, and features that
+used to be acceptable in previous drafts of the standard, such as the ARM
+[Annotated C++ Reference Manual], are no longer accepted. In order to allow
+compilation of C++ written to such drafts, g++ contains some backwards
+compatibilities. @emph{All such backwards compatibility features are
+liable to disappear in future versions of g++.} They should be considered
+deprecated @xref{Deprecated Features}.
+
+@table @code
+@item For scope
+If a variable is declared at for scope, it used to remain in scope until
+the end of the scope which contained the for statement (rather than just
+within the for scope). g++ retains this, but issues a warning, if such a
+variable is accessed outside the for scope.
+
+@item implicit C language
+Old C system header files did not contain an @code{extern "C" @{...@}}
+scope to set the language. On such systems, all header files are
+implicitly scoped inside a C language scope. Also, an empty prototype
+@code{()} will be treated as an unspecified number of arguments, rather
+than no arguments, as C++ demands.
+@end table