This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Add macros for diagnostic control, use them in locale/weightwc.h
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 18 Nov 2014 15:49:05 -0800
- Subject: Re: Add macros for diagnostic control, use them in locale/weightwc.h
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1411181803130 dot 11642 at digraph dot polyomino dot org dot uk> <546BB1B1 dot 50000 at cs dot ucla dot edu> <alpine dot DEB dot 2 dot 10 dot 1411182256130 dot 18922 at digraph dot polyomino dot org dot uk>
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.
(The above should use _Pragma not #pragma given your other comments, but
this doesn't affect the main point here.)