This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Update -Wtraditional documentation


Committed.

Neil.

	* invoke.texi, cpp.texi: Update -Wtraditional documentation.

Index: cpp.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cpp.texi,v
retrieving revision 1.44
diff -u -p -r1.44 cpp.texi
--- cpp.texi	2001/01/24 18:44:40	1.44
+++ cpp.texi	2001/02/02 19:35:00
@@ -3313,6 +3313,39 @@ Requests @samp{-Wcomment}, @samp{-Wtrigr
 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.
Index: invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/invoke.texi,v
retrieving revision 1.271
diff -u -p -r1.271 invoke.texi
--- invoke.texi	2001/02/02 17:42:00	1.271
+++ invoke.texi	2001/02/02 19:35:40
@@ -2068,11 +2068,37 @@ 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
 the block.
 
@@ -2093,12 +2119,6 @@ typically represent bit patterns, are no
 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 assumpt
 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]