This is the mail archive of the gcc-bugs@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]

Re: glimits.h is not compatible with -traditional


>  > The warning results from defines in glimits.h that are not compatible with
>  > -traditional.  For example,
>  > 
>  > #define UINT_MAX (INT_MAX * 2U + 1)
>  > 
>  > There are also various C99 defines in glimits.h which are not compatible
>  > with -traditional (long long stuff).  I think these need to be surrounded
>  > by appropriate ifdef __STDC__'s.
>  > 
>  > Dave
> 
> Note that it's the -Wtraditional flag (not -traditional) that is
> warning about these, so wrapping things with __STDC__ won't change the
> noise.  And -Wtraditional won't warn about stuff declared in system
> headers.  Only stuff that's used in user code will actually warn.  So
> if you don't make use of the e.g. long long stuff, then your program
> will pass without any -Wtraditional warnings.

I agree that wrapping with __STDC__ won't change the noise from
-Wtraditional, but glimits.h becomes part of limits.h and might be
included by a "traditional" program compiled by gcc.  The header
limits.h probably was not on any traditional systems.  However, new
software will use it if its available.  Thus, I think glimits.h
should be made compatible with -traditional.

I have a patch which I am testing.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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