This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add macros for diagnostic control, use them in locale/weightwc.h

On Tue, 18 Nov 2014, Paul Eggert wrote:

> On 11/18/2014 03:00 PM, Joseph Myers wrote:
> > Checking it means reviewing if the warning still appears...  We don't want
> > to introduce lots of build failures every time GCC branches and the mainline
> > version increases.
> >   
> In that case, we can do the equivalent of the following instead:
>    #if __GNUC_PREREQ (4, 7)
>    # if !__GNUC_PREPREQ (4, 10)
>    #  pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
>    # else
>    #  pragma GCC diagnostic warning "-Wmaybe-uninitialized"
>    # endif
>    #endif
> That is,  we can check the "4.9" without causing build failures in 5.0.  That
> should be better than having an unchecked 4.9 sitting in the source.

But the basic point of using -Werror is that people don't look at warnings 
that scroll by, and shouldn't need to; cluttering build logs up with 
warnings doesn't help.  And the relevant time to check is when 4.9 is no 
longer supported (one person, or one per architecture, doing the checks 
then), rather than keeping updating the pragma every time a new GCC 
version branches.

Making the pragma turn the diagnostic into a warning is an interesting 
idea for how to do the checks at the point when we increase the minimum 
GCC version - it may be more convenient to turn all the cases where 4.9 is 
specified into warnings to check them all at once, rather than try 
deleting them and see which need adding back.  I don't think, however, 
that we need to work out now how we'll manage those checks in future and 
whether macros making more sophisticated use of the version number might 
be useful then.

Joseph S. Myers

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