This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Behavior of -Wtraditional WRT numeric suffixes and docs
- To: neil at daikokuya dot demon dot co dot uk
- Subject: Re: Behavior of -Wtraditional WRT numeric suffixes and docs
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 11 Apr 2001 17:24:43 -0400 (EDT)
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
> From: Neil Booth <neil@daikokuya.demon.co.uk>
>
> Kaveh R. Ghazi wrote:-
>
> > IIRC, one of your recent patches made the following paragraph in the
> > docs obsolete when describing items warned about in -Wtraditional, (at
> > least when using the integrated preprocessor.) True?
> >
> > > @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.
> >
> > I think everything after the work "Note," no longer applies if you use
> > the integrated cpp.
> >
> > Should we just remove it or add the caveat about when it applies?
>
> Yes, you're right. Your call on whether to just delete it, or say
> it applies to GCC versions earlier than 3.0. If these
> -Wtraditional checks were something we only introduced between
> major releases, and have not always been there, we might as well
> kill the note altogether.
> Neil.
(Sorry this sat in my inbox for a month.)
Regarding major releases, I know this warning wasn't in 2.95, but I
don't know if e.g. the RH-2.96 had it. FWIW, I added the feature on
Aug 10, 2000.
Anyway, here's my attempt at rewording the documentation.
Ok for trunk and 3.0 branch?
--Kaveh
2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cpp.texi (-Wtraditional): Update description.
* invoke.texi (-Wtraditional): Likewise.
diff -rup /tmp/foo/egcs-CVS20010410/gcc/cpp.texi egcs-CVS20010410/gcc/cpp.texi
--- /tmp/foo/egcs-CVS20010410/gcc/cpp.texi Thu Mar 15 07:43:12 2001
+++ egcs-CVS20010410/gcc/cpp.texi Wed Apr 11 16:46:39 2001
@@ -3339,7 +3339,8 @@ Requests @samp{-Wcomment}, @samp{-Wtrigr
@item -Wtraditional
@findex -Wtraditional
Warn about certain constructs that behave differently in traditional and
-ISO C@.
+ISO C@. Also warn about ISO C constructs that have no traditional C
+equivalent, and/or problematic constructs which should be avoided.
@itemize @bullet
@item
@@ -3368,10 +3369,9 @@ The unary plus operator.
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.
+macros in limits.h. Use of these macros in user code might normally
+lead to spurious warnings, however gcc's integrated preprocessor has
+enough context to avoid warning in these cases.
@end itemize
@item -Wundef
diff -rup /tmp/foo/egcs-CVS20010410/gcc/invoke.texi egcs-CVS20010410/gcc/invoke.texi
--- /tmp/foo/egcs-CVS20010410/gcc/invoke.texi Tue Apr 10 18:36:20 2001
+++ egcs-CVS20010410/gcc/invoke.texi Wed Apr 11 16:46:40 2001
@@ -2055,7 +2055,8 @@ probably mistaken.
@item -Wtraditional (C only)
Warn about certain constructs that behave differently in traditional and
-ISO C.
+ISO C. Also warn about ISO C constructs that have no traditional C
+equivalent, and/or problematic constructs which should be avoided.
@itemize @bullet
@item
@@ -2085,9 +2086,9 @@ The `U' integer constant suffix, or the
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.
+Use of these macros in user code might normally lead to spurious
+warnings, however gcc's integrated preprocessor has enough context to
+avoid warning in these cases.
@item
A function declared external in one block and then used after the end of