aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-02-02 19:39:47 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-02-02 19:39:47 +0000
commitda312b554476add253f01a95dca08955d4034d11 (patch)
tree402372cd6ab7f0a80af9a8e19ef20279467fb1ce /gcc
parent2ca46e8a7073bd6beea8f3749348b8b54c528e42 (diff)
downloadgcc-da312b554476add253f01a95dca08955d4034d11.zip
gcc-da312b554476add253f01a95dca08955d4034d11.tar.gz
gcc-da312b554476add253f01a95dca08955d4034d11.tar.bz2
* cpp.texi, invoke.texi: Update -Wtraditional documentation.
From-SVN: r39414
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cpp.texi33
-rw-r--r--gcc/invoke.texi47
3 files changed, 66 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 49c0628..9c80dcd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2001-02-02 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cpp.texi, invoke.texi: Update -Wtraditional documentation.
+
2001-02-02 Alexandre Oliva <aoliva@redhat.com>
* config/sh/sh.c (output_far_jump): Don't use braf on SH1. Emit
diff --git a/gcc/cpp.texi b/gcc/cpp.texi
index 19e9566..6086e26 100644
--- a/gcc/cpp.texi
+++ b/gcc/cpp.texi
@@ -3313,6 +3313,39 @@ Requests @samp{-Wcomment}, @samp{-Wtrigraphs}, and @samp{-Wwhite-space}
Warn about certain constructs that behave differently in traditional and
ISO C@.
+@itemize @bullet
+@item
+Macro parameters that appear within string literals in the macro body.
+In traditional C macro replacement takes place within string literals,
+but does not in ISO C.
+
+@item
+In traditional C, some preprocessor directives did not exist.
+Traditional preprocessors would only consider a line to be a directive
+if the @samp{#} appeared in column 1 on the line. Therefore
+@samp{-Wtraditional} warns about directives that traditional C
+understands but would ignore because the @samp{#} does not appear as the
+first character on the line. It also suggests you hide directives like
+@samp{#pragma} not understood by traditional C by indenting them. Some
+traditional implementations would not recognise @samp{#elif}, so it
+suggests avoiding it altogether.
+
+@item
+A function-like macro that appears without arguments.
+
+@item
+The unary plus operator.
+
+@item
+The `U' integer constant suffix. (Traditonal C does support the `L'
+suffix on integer constants.) Note, these suffixes appear in macros
+defined in the system headers of most modern systems, e.g. the _MIN/_MAX
+macros in limits.h. Use of these macros can lead to spurious warnings
+as they do not necessarily reflect whether the code in question is any
+less portable to traditional C given that suitable backup definitions
+are provided.
+@end itemize
+
@item -Wundef
@findex -Wundef
Warn if an undefined identifier is evaluated in an @samp{#if} directive.
diff --git a/gcc/invoke.texi b/gcc/invoke.texi
index e161491..beec0e7 100644
--- a/gcc/invoke.texi
+++ b/gcc/invoke.texi
@@ -2068,9 +2068,35 @@ ISO C.
@itemize @bullet
@item
-Macro arguments occurring within string constants in the macro body.
-These would substitute the argument in traditional C, but are part of
-the constant in ISO C.
+Macro parameters that appear within string literals in the macro body.
+In traditional C macro replacement takes place within string literals,
+but does not in ISO C.
+
+@item
+In traditional C, some preprocessor directives did not exist.
+Traditional preprocessors would only consider a line to be a directive
+if the @samp{#} appeared in column 1 on the line. Therefore
+@samp{-Wtraditional} warns about directives that traditional C
+understands but would ignore because the @samp{#} does not appear as the
+first character on the line. It also suggests you hide directives like
+@samp{#pragma} not understood by traditional C by indenting them. Some
+traditional implementations would not recognise @samp{#elif}, so it
+suggests avoiding it altogether.
+
+@item
+A function-like macro that appears without arguments.
+
+@item
+The unary plus operator.
+
+@item
+The `U' integer constant suffix, or the `F' or `L' floating point
+constant suffixes. (Traditonal C does support the `L' suffix on integer
+constants.) Note, these suffixes appear in macros defined in the system
+headers of most modern systems, e.g. the _MIN/_MAX macros in limits.h.
+Use of these macros can lead to spurious warnings as they do not
+necessarily reflect whether the code in question is any less portable to
+traditional C given that suitable backup definitions are provided.
@item
A function declared external in one block and then used after the end of
@@ -2093,12 +2119,6 @@ typically represent bit patterns, are not warned about.
Usage of ISO string concatenation is detected.
@item
-A function macro appears without arguments.
-
-@item
-The unary plus operator.
-
-@item
Initialization of automatic aggregates.
@item
@@ -2111,15 +2131,6 @@ omitted. This is done under the assumption that the zero initializer in
user code appears conditioned on e.g. @code{__STDC__} to avoid missing
initializer warnings and relies on default initialization to zero in the
traditional C case.
-
-@item
-The `U' integer constant suffix, or the `F' or `L' floating point
-constant suffixes. (Traditonal C does support the `L' suffix on integer
-constants.) Note, these suffixes appear in macros defined in the system
-headers of most modern systems, e.g. the _MIN/_MAX macros in limits.h.
-Use of these macros can lead to spurious warnings as they do not
-necessarily reflect whether the code in question is any less portable to
-traditional C given that suitable backup definitions are provided.
@end itemize
@item -Wundef