summaryrefslogtreecommitdiff
path: root/gcc/cpp.texi
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-17 23:37:19 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-17 23:37:19 +0000
commite46f56735efc7e6083f08782e79738fdc52ca0ed (patch)
tree662f9ef1f6360e03f9a4e747bf73cf9551fe3fa3 /gcc/cpp.texi
parent1c22039ab64be7d28cda45cc9896ad4e02b3ad16 (diff)
downloadgcc-e46f56735efc7e6083f08782e79738fdc52ca0ed.tar.gz
* cppspec.c: Insert -no-gcc into command line unless -gcc was
given by user. * gcc.c (default_compilers): Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc was not given. * objc/lang-specs.h: Likewise. * cpp.texi: Document -x and -std options; explain that -lang is no longer supported. Minor related corrections. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26990 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpp.texi')
-rw-r--r--gcc/cpp.texi108
1 files changed, 72 insertions, 36 deletions
diff --git a/gcc/cpp.texi b/gcc/cpp.texi
index 7552cf97d61..ca501379577 100644
--- a/gcc/cpp.texi
+++ b/gcc/cpp.texi
@@ -2658,7 +2658,9 @@ warnings.
@item -Wtrigraphs
@findex -Wtrigraphs
-Warn if any trigraphs are encountered (assuming they are enabled).
+Warn if any trigraphs are encountered. Currently this only works if you
+have turned trigraphs on with @samp{-trigraphs} or @samp{-ansi}; in the
+future this restriction will be removed.
@item -Wcomment
@findex -Wcomment
@@ -2756,6 +2758,12 @@ is not predefined.
@findex -undef
Do not predefine any nonstandard macros.
+@item -gcc
+@findex -gcc
+Define the macros @var{__GNUC__} and @var{__GNUC_MINOR__}. These are
+defined automatically when you use @samp{gcc -E}; you can turn them off
+in that case with @samp{-no-gcc}.
+
@item -A @var{predicate}(@var{answer})
@findex -A
Make an assertion with the predicate @var{predicate} and answer
@@ -2763,7 +2771,8 @@ Make an assertion with the predicate @var{predicate} and answer
@noindent
You can use @samp{-A-} to disable all predefined assertions; it also
-undefines all predefined macros that identify the type of target system.
+undefines all predefined macros and all macros that preceded it on the
+command line.
@item -dM
@findex -dM
@@ -2874,48 +2883,75 @@ Add a directory to the beginning of the second include path, marking it
as a system directory, so that it gets the same special treatment as
is applied to the standard system directories.
-@item -lang-c
-@itemx -lang-c89
-@itemx -lang-c++
-@itemx -lang-objc
-@itemx -lang-objc++
-@findex -lang-c
-@findex -lang-c89
-@findex -lang-c++
-@findex -lang-objc
-@findex -lang-objc++
-Specify the source language. @samp{-lang-c} is the default; it
-allows recognition of C++ comments (comments that begin with
-@samp{//} and end at end of line) and hexadecimal floating-point constants,
-since these features will most likely appear in the next C standard.
-@samp{-lang-c89} disables recognition of C++ comments and
-hexadecimal floating-point constants. @samp{-lang-c++}
-handles C++ comment syntax and includes extra default include
-directories for C++. @samp{-lang-objc} enables the Objective C
-@samp{#import} directive. @samp{-lang-objc++} enables both C++ and Objective C
-extensions.
-
-These options are generated by the compiler driver @code{gcc}, but not
-passed from the @samp{gcc} command line unless you use the driver's
-@samp{-Wp} option.
-
-@item -lint
+@item -x c
+@itemx -x c++
+@itemx -x objective-c
+@itemx -x assembler-with-cpp
+@findex -x c
+@findex -x objective-c
+@findex -x assembler-with-cpp
+Specify the source language: C, C++, Objective-C, or assembly. This has
+nothing to do with standards conformance or extensions; it merely
+selects which base syntax to expect. If you give none of these options,
+cpp will deduce the language from the extension of the source file:
+@samp{.c}, @samp{.cc}, @samp{.m}, or @samp{.S}. Some other common
+extensions for C++ and assembly are also recognized. If cpp does not
+recognize the extension, it will treat the file as C; this is the most
+generic mode.
+
+@strong{Note:} Previous versions of cpp accepted a @samp{-lang} option
+which selected both the language and the standards conformance level.
+This option has been removed, because it conflicts with the @samp{-l}
+option.
+
+@item -std=@var{standard}
+@itemx -ansi
+@findex -std
+@findex -ansi
+Specify the standard to which the code should conform. Currently cpp
+only knows about the standards for C; other language standards will be
+added in the future.
+
+@var{standard}
+may be one of:
+@table @code
+@item iso9899:1990
+The ISO C standard from 1990.
+
+@item iso9899:199409
+@itemx c89
+The 1990 C standard, as amended in 1994. @samp{c89} is the customary
+shorthand for this version of the standard.
+
+The @samp{-ansi} option is equivalent to @samp{-std=c89}.
+
+@item iso9899:199x
+@itemx c9x
+The revised ISO C standard, which is expected to be promulgated some
+time in 1999. It has not been approved yet, hence the @samp{x}.
+
+@item gnu89
+The 1990 C standard plus GNU extensions. This is the default.
+
+@item gnu9x
+The 199x C standard plus GNU extensions.
+@end table
+
+@item -Wp,-lint
+@findex -lint
Look for commands to the program checker @code{lint} embedded in
comments, and emit them preceded by @samp{#pragma lint}. For example,
the comment @samp{/* NOTREACHED */} becomes @samp{#pragma lint
NOTREACHED}.
-This option is available only when you call @code{cpp} directly;
-@code{gcc} will not pass it from its command line.
+Because of the clash with @samp{-l}, you must use the awkward syntax
+above. In a future release, this option will be replaced by
+@samp{-flint} or @samp{-Wlint}; we are not sure which yet.
@item -$
@findex -$
-Forbid the use of @samp{$} in identifiers. This was formerly required
-for strict conformance to the C Standard before the standard was
-corrected.
-
-This option is available only when you call @code{cpp} directly;
-@code{gcc} will not pass it from its command line.
+Forbid the use of @samp{$} in identifiers. The C standard does not
+permit this, but it is a common extension.
@end table