This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: More cpp.texi updates
- To: Zack Weinberg <zackw at Stanford dot EDU>
- Subject: Re: More cpp.texi updates
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Sat, 16 Jun 2001 11:51:12 +0100
- Cc: gcc-patches at gcc dot gnu dot org
Zack Weinberg wrote:-
> Looks good except for two things.
I've taken care of those and this is the result. I'll commit this.
Should we keep regenerating the man pages on mainline, or do we only
do that for a release?
Neil.
* cpp.texi, invoke.texi: Update.
* cpp.1, gcc.1: Regenerate.
Index: cpp.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/cpp.texi,v
retrieving revision 1.5
diff -u -p -r1.5 cpp.texi
--- cpp.texi 2001/06/15 23:40:33 1.5
+++ cpp.texi 2001/06/16 10:48:45
@@ -986,7 +986,7 @@ These rules are implementation-defined b
standard. To minimize the risk of different compilers interpreting your
computed includes differently, we recommend you use only a single
object-like macro which expands to a string constant. This will also
-minimize any confusion to people reading your program.
+minimize confusion for people reading your program.
@node Wrapper Headers
@section Wrapper Headers
@@ -1634,7 +1634,7 @@ eprintf("success!\n", );
@expansion{} fprintf(stderr, "success!\n", );
@end example
-GNU CPP has a pair of extensions which deals with this problem. First,
+GNU CPP has a pair of extensions which deal with this problem. First,
you are allowed to leave the variable argument out entirely:
@example
@@ -1893,7 +1893,7 @@ testing @code{@w{(__GNUC__ && __cplusplu
@item __STRICT_ANSI__
GCC defines this macro if and only if the @option{-ansi} switch, or a
@option{-std} switch specifying strict conformance to some version of ISO C,
-was specified when GCC was invoked. Its definition is the null string.
+was specified when GCC was invoked. It is defined to @samp{1}.
This macro exists primarily to direct GNU libc's header files to
restrict their definitions to the minimal set found in the 1989 C
standard.
@@ -3006,13 +3006,13 @@ symbolic debuggers to be able to refer t
@samp{#line} directives into the output file. @samp{#line} is a
directive that specifies the original line number and source file name
for subsequent input in the current preprocessor input file.
-@samp{#line} has four variants:
+@samp{#line} has three variants:
@table @code
@item #line @var{linenum}
-@var{linenum} is a decimal integer constant. It specifies the line
-number which should be reported for the following line of input.
-Subsequent lines are counted from @var{linenum}.
+@var{linenum} is a non-negative decimal integer constant. It specifies
+the line number which should be reported for the following line of
+input. Subsequent lines are counted from @var{linenum}.
@item #line @var{linenum} @var{filename}
@var{linenum} is the same as for the first form, and has the same
@@ -3022,15 +3022,7 @@ file it specifies, until something else
@item #line @var{anything else}
@var{anything else} is checked for macro calls, which are expanded.
-The result should match one of the above three forms.
-
-@item # @var{linenum} @var{filename} @var{flags@dots{}}
-This form is a GCC extension. @var{linenum} and @var{filename} are the
-same as the second form. The @var{flags} are small increasing positive
-integers, which have the same meaning as the flags which can appear at
-the end of a linemarker in the preprocessor's output.
-@xref{Preprocessor Output}. Note that this form does not use the
-directive name @samp{line}.
+The result should match one of the above two forms.
@end table
@samp{#line} directives alter the results of the @code{__FILE__} and
@@ -3236,6 +3228,12 @@ wrapped in an implicit @code{extern "C"}
@c maybe cross reference NO_IMPLICIT_EXTERN_C
@end table
+As an extension, the preprocessor accepts linemarkers in non-assembler
+input files. They are treated like the corresponding @samp{#line}
+directive, (@pxref{Line Control}), except that trailing flags are
+permitted, and are interpreted with the meanings described above. If
+multiple flags are given, they must be in ascending order.
+
Some directives may be duplicated in the output of the preprocessor.
These are @samp{#ident} (always), @samp{#pragma} (only if the
preprocessor does not handle the pragma itself), and @samp{#define} and
@@ -3815,10 +3813,16 @@ Either @var{infile} or @var{outfile} may
means to write to standard output. Also, if either file is omitted, it
means the same as if @option{-} had been specified for that file.
-All single-letter options which take an argument may have that argument
-appear immediately after the option letter, or with a space between
-option and argument: @option{-Ifoo} and @option{-I foo} have the same
-effect.
+Unless otherwise noted, or the option ends in @samp{=}, all options
+which take an argument may have that argument appear either immediately
+after the option, or with a space between option and argument:
+@option{-Ifoo} and @option{-I foo} have the same effect.
+
+@cindex grouping options
+@cindex options, grouping
+Many options have multi-letter names; therefore multiple single-letter
+options may @emph{not} be grouped: @option{-dM} is very different from
+@w{@samp{-d -M}}.
@cindex options
@table @gcctabopt
@@ -4170,7 +4174,15 @@ the command line. Also, undefine all pr
macros preceding it on the command line. (This is a historical wart and
may change in the future.)
-@item -dM
+@item -dCHARS
+@var{CHARS} is a sequence of one or more of the following characters,
+and must not be preceded by a space. Other characters are interpreted
+by the compiler proper, or reserved for future versions of GCC, and so
+are silently ignored. If you specify characters whose behavior
+conflicts, the result is undefined.
+
+@table @samp
+@item M
Instead of the normal output, generate a list of @samp{#define}
directives for all the macros defined during the execution of the
preprocessor, including predefined macros. This gives you a way of
@@ -4184,18 +4196,19 @@ touch foo.h; cpp -dM foo.h
@noindent
will show all the predefined macros.
-@item -dD
-Like @option{-dM} except in two respects: it does @emph{not} include the
+@item D
+Like @samp{M} except in two respects: it does @emph{not} include the
predefined macros, and it outputs @emph{both} the @samp{#define}
directives and the result of preprocessing. Both kinds of output go to
the standard output file.
-@item -dN
-Like @option{-dD}, but emit only the macro names, not their expansions.
+@item N
+Like @samp{D}, but emit only the macro names, not their expansions.
-@item -dI
+@item I
Output @samp{#include} directives in addition to the result of
preprocessing.
+@end table
@item -P
Inhibit generation of linemarkers in the output from the preprocessor.
Index: invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.13
diff -u -p -r1.13 invoke.texi
--- invoke.texi 2001/06/14 22:51:17 1.13
+++ invoke.texi 2001/06/16 10:49:17
@@ -4059,12 +4059,14 @@ preprocessing.
Indicate to the preprocessor that the input file has already been
preprocessed. This suppresses things like macro expansion, trigraph
conversion, escaped newline splicing, and processing of most directives.
-In this mode the integrated preprocessor is little more than a tokenizer
-for the front ends.
+The preprocessor still recognizes and removes comments, so that you can
+pass a file preprocessed with @option{-C} to the compiler without
+problems. In this mode the integrated preprocessor is little more than
+a tokenizer for the front ends.
@option{-fpreprocessed} is implicit if the input file has one of the
-extensions @samp{i}, @samp{ii} or @samp{mi} indicating it has already
-been preprocessed.
+extensions @samp{i}, @samp{ii} or @samp{mi}. These are the extensions
+that GCC uses for preprocessed files created by @option{-save-temps}.
@item -trigraphs
@opindex trigraphs