Tautological comparison in gcc 6.1.1

Martin Schwenke martin at meltin.net
Thu Jul 14 05:21:00 UTC 2016


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 global "-Wno-error=tautological-compare" or
"#ifdef gcc >= 6" around the _Pragma hunks.

peace & happiness,
martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160714/1c73ba9c/attachment.sig>


More information about the samba-technical mailing list