Tautological comparison in gcc 6.1.1

Michael Adam obnox at samba.org
Thu Jul 14 07:52:05 UTC 2016


On 2016-07-14 at 15:21 +1000, Martin Schwenke wrote:
> On Thu, 14 Jul 2016 06:23:57 +0200, Stefan Metzmacher <metze at samba.org>
> wrote:
> 
> > Am 14.07.2016 um 04:58 schrieb Ira Cooper:
> > > On Wed, Jul 13, 2016 at 6:29 PM, Michael Adam <obnox at samba.org> wrote:
> > >   
> > >> On 2016-07-13 at 15:23 -0700, Jeremy Allison wrote:  
> >  [...]  
> >  [...]  
> >  [...]  
> >  [...]  
> >  [...]  
> >  [...]  
> >  [...]  
> >  [...]  
> >  [...]  
> > >>
> > >> here it is
> > >>
> > >> Thanks - Michael
> > >>  
> > > 
> > > I agree with Jeremy, this is u-g-l-y.  But there is no cleaner solution.  
> > 
> > We currently using:
> > conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Werror
> > -Wno-error=deprecated-declarations', testflags=True)
> > can't we just add
> > conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=tautological-compare',
> > testflags=True)
> > ?
> > 
> > That would fix it for all cases not just the macros.
> 
> Samba/CTDB no longer builds on (unpatched) RHEL 6.6 with GCC 4.4.7.
> 
> [ 46/248] Compiling lib/tdb_wrap/tdb_wrap.c
> ../lib/tdb_wrap/tdb_wrap.c: In function 'tdb_wrap_private_destructor':
> ../lib/tdb_wrap/tdb_wrap.c:81: error: #pragma GCC diagnostic not allowed inside functions
> ../lib/tdb_wrap/tdb_wrap.c:81: error: #pragma GCC diagnostic not allowed inside functions
> ../lib/tdb_wrap/tdb_wrap.c:81: error: #pragma GCC diagnostic not allowed inside functions
> ../lib/tdb_wrap/tdb_wrap.c:81: error: #pragma GCC diagnostic not allowed inside functions
> 
> GCC version is:
> 
>   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)
> 
> RHEL 6.8 has a later build but the changelog doesn't mention any
> changes to pragma magic.
> 
> It will have to be either
>
> "#ifdef gcc >= 6" around the _Pragma hunks.

Guess that does not work, because it is inside
a macro: This is why we used _Pragma instead
of #pragma. And the ignore -Wpramgas was intended
to fix older gccs, but apparently I did not test
with old enough gcc. :-/

Apologies for the inconvenience..

> global "-Wno-error=tautological-compare" or

Right, what our patch was trying to avoid was getting
rid of the other possibly useful cases of -Wtautological-compare
but if everyone agrees, then we can just silence
them altogether with a global setting...

Will propose another patch...

Cheers - Michael


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160714/b9153d6d/signature.sig>


More information about the samba-technical mailing list