OSDN Git Service

* doc/invoke.texi (RS/6000 and PowerPC Options): Add -mmfcrf,
[pf3gnuchains/gcc-fork.git] / gcc / doc / cpp.texi
index 66f9281..c019adb 100644 (file)
@@ -6,10 +6,12 @@
 @c @cropmarks
 @c @finalout
 
+@include gcc-common.texi
+
 @copying
 @c man begin COPYRIGHT
 Copyright @copyright{} 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
-1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
@@ -40,10 +42,6 @@ This manual contains no Invariant Sections.  The Front-Cover Texts are
 @c man end
 @end copying
 
-@macro gcctabopt{body}
-@code{\body\}
-@end macro
-
 @c Create a separate index for command line options.
 @defcodeindex op
 @syncodeindex vr op
@@ -60,8 +58,7 @@ This manual contains no Invariant Sections.  The Front-Cover Texts are
 
 @titlepage
 @title The C Preprocessor
-@subtitle Last revised April 2001
-@subtitle for GCC version 3
+@subtitle for GCC version @value{version-GCC}
 @author Richard M. Stallman
 @author Zachary Weinberg
 @page
@@ -284,11 +281,11 @@ the character in the source character set that they represent, then
 converted to the execution character set, just like unescaped
 characters.
 
+Unless the experimental @option{-fextended-identifiers} option is used,
 GCC does not permit the use of characters outside the ASCII range, nor
-@samp{\u} and @samp{\U} escapes, in identifiers.  We hope this will
-change eventually, but there are problems with the standard semantics
-of such ``extended identifiers'' which must be resolved through the
-ISO C and C++ committees first.
+@samp{\u} and @samp{\U} escapes, in identifiers.  Even with that
+option, characters outside the ASCII range can only be specified with
+the @samp{\u} and @samp{\U} escapes, not used directly in identifiers.
 
 @node Initial processing
 @section Initial processing
@@ -513,8 +510,10 @@ In the 1999 C standard, identifiers may contain letters which are not
 part of the ``basic source character set'', at the implementation's
 discretion (such as accented Latin letters, Greek letters, or Chinese
 ideograms).  This may be done with an extended character set, or the
-@samp{\u} and @samp{\U} escape sequences.  GCC does not presently
-implement either feature in the preprocessor or the compiler.
+@samp{\u} and @samp{\U} escape sequences.  The implementation of this
+feature in GCC is experimental; such characters are only accepted in
+the @samp{\u} and @samp{\U} forms and only if
+@option{-fextended-identifiers} is used.
 
 As an extension, GCC treats @samp{$} as a letter.  This is for
 compatibility with some systems, such as VMS, where @samp{$} is commonly
@@ -1321,7 +1320,7 @@ name, and you wish to use the function sometimes.
 
 @smallexample
 extern void foo(void);
-#define foo() /* optimized inline version */
+#define foo() /* @r{optimized inline version} */
 @dots{}
   foo();
   funcptr = foo;
@@ -1930,16 +1929,16 @@ These macros are defined by all GNU compilers that use the C
 preprocessor: C, C++, and Objective-C@.  Their values are the major
 version, minor version, and patch level of the compiler, as integer
 constants.  For example, GCC 3.2.1 will define @code{__GNUC__} to 3,
-@code{__GNUC_MINOR__} to 2, and @code{__GNUC_PATCHLEVEL__} to 1.  They
-are defined only when the entire compiler is in use; if you invoke the
-preprocessor directly, they are not defined.
+@code{__GNUC_MINOR__} to 2, and @code{__GNUC_PATCHLEVEL__} to 1.  These
+macros are also defined if you invoke the preprocessor directly.
 
 @code{__GNUC_PATCHLEVEL__} is new to GCC 3.0; it is also present in the
 widely-used development snapshots leading up to 3.0 (which identify
 themselves as GCC 2.96 or 2.97, depending on which snapshot you have).
 
 If all you need to know is whether or not your program is being compiled
-by GCC, you can simply test @code{__GNUC__}.  If you need to write code
+by GCC, or a non-GCC compiler that claims to accept the GNU C dialects,
+you can simply test @code{__GNUC__}.  If you need to write code
 which depends on a specific version, you must be more careful.  Each
 time the minor version is increased, the patch level is reset to zero;
 each time the major version is increased (which happens rarely), the
@@ -2084,11 +2083,31 @@ respectively.  They exist to make the standard header given numerical limits
 work correctly.  You should not use these macros directly; instead, include
 the appropriate headers.
 
+@item __DEPRECATED
+This macro is defined, with value 1, when compiling a C++ source file
+with warnings about deprecated constructs enabled.  These warnings are
+enabled by default, but can be disabled with @option{-Wno-deprecated}.
+
+@item __EXCEPTIONS
+This macro is defined, with value 1, when compiling a C++ source file
+with exceptions enabled.  If @option{-fno-exceptions} was used when
+compiling the file, then this macro will not be defined.
+
 @item __USING_SJLJ_EXCEPTIONS__
 This macro is defined, with value 1, if the compiler uses the old
 mechanism based on @code{setjmp} and @code{longjmp} for exception
 handling.
 
+@item __GXX_WEAK__
+This macro is defined when compiling a C++ source file.  It has the
+value 1 if the compiler will use weak symbols, COMDAT sections, or
+other similar techniques to collapse symbols with ``vague linkage''
+that are defined in multiple translation units.  If the compiler will
+not collapse such symbols, this macro is defined with value 0.  In
+general, user code should not need to make use of this macro; the
+purpose of this macro is to ease implementation of the C++ runtime
+library provided with G++.
+
 @item __NEXT_RUNTIME__
 This macro is defined, with value 1, if (and only if) the NeXT runtime
 (as in @option{-fnext-runtime}) is in use for Objective-C@.  If the GNU
@@ -2100,6 +2119,15 @@ macro to determine which runtime (NeXT or GNU) is being used.
 These macros are defined, with value 1, if (and only if) the compilation
 is for a target where @code{long int} and pointer both use 64-bits and
 @code{int} uses 32-bit.
+
+@item __SSP__
+This macro is defined, with value 1, when @option{-fstack-protector} is in
+use.
+
+@item __SSP_ALL__
+This macro is defined, with value 2, when @option{-fstack-protector-all} is
+in use.
+
 @end table
 
 @node System-specific Predefined Macros
@@ -2214,7 +2242,7 @@ These definitions are effectively the same:
 @smallexample
 #define FOUR (2 + 2)
 #define FOUR         (2    +    2)
-#define FOUR (2 /* two */ + 2)
+#define FOUR (2 /* @r{two} */ + 2)
 @end smallexample
 @noindent
 but these are not:
@@ -3355,18 +3383,15 @@ current file to be treated as if it came from a system header.
 @chapter Other Directives
 
 @findex #ident
+@findex #sccs
 The @samp{#ident} directive takes one argument, a string constant.  On
 some systems, that string constant is copied into a special segment of
-the object file.  On other systems, the directive is ignored.
+the object file.  On other systems, the directive is ignored.  The
+@samp{#sccs} directive is a synonym for @samp{#ident}.
 
-This directive is not part of the C standard, but it is not an official
-GNU extension either.  We believe it came from System V@.
-
-@findex #sccs
-The @samp{#sccs} directive is recognized, because it appears in the
-header files of some systems.  It is a very old, obscure, extension
-which we did not invent, and we have been unable to find any
-documentation of what it should do, so GCC simply ignores it.
+These directives are not part of the C standard, but they are not
+official GNU extensions either.  What historical information we have
+been able to find, suggests they originated with System V@.
 
 @cindex null directive
 The @dfn{null directive} consists of a @samp{#} followed by a newline,
@@ -3541,8 +3566,8 @@ require matching quotes.  For example:
 @smallexample
 #define m This macro's fine and has an unmatched quote
 "/* This is not a comment.  */
-/* This is a comment.  The following #include directive
-   is ill-formed.  */
+/* @r{This is a comment.  The following #include directive
+   is ill-formed.}  */
 #include <stdio.h
 @end smallexample
 
@@ -3629,7 +3654,7 @@ example
 
 @smallexample
 #define str(x) "x"
-str(/* A comment */some text )
+str(/* @r{A comment} */some text )
      @expansion{} "some text "
 @end smallexample
 
@@ -3767,8 +3792,10 @@ character set may be controlled by the user, with the
 
 The C and C++ standards allow identifiers to be composed of @samp{_}
 and the alphanumeric characters.  C++ and C99 also allow universal
-character names (not implemented in GCC), and C99 further permits
-implementation-defined characters.
+character names, and C99 further permits implementation-defined
+characters.  GCC currently only permits universal character names if
+@option{-fextended-identifiers} is used, because the implementation of
+universal character names in identifiers is experimental.
 
 GCC allows the @samp{$} character in identifiers as an extension for
 most targets.  This is true regardless of the @option{std=} switch,
@@ -4048,7 +4075,7 @@ they generally represent bugs in the snapshots.
 
 @item -I- deprecated
 
-This option has been deprecated in 3.5.  @option{-iquote} is meant to
+This option has been deprecated in 4.0.  @option{-iquote} is meant to
 replace the need for this option.
 
 @item Order of evaluation of @samp{#} and @samp{##} operators
@@ -4133,7 +4160,7 @@ here are also acceptable to the C compiler and have the same meaning,
 except that the C compiler has different rules for specifying the output
 file.
 
-@strong{Note:} Whether you use the preprocessor by way of @command{gcc}
+@emph{Note:} Whether you use the preprocessor by way of @command{gcc}
 or @command{cpp}, the @dfn{compiler driver} is run first.  This
 program's purpose is to translate your command into invocations of the
 programs that do the actual work.  Their command line interfaces are