GNU bug report logs - #8732
uinttostr: comparison of unsigned expression < 0 is always false

Previous Next

Package: coreutils;

Reported by: "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>

Date: Wed, 25 May 2011 18:20:02 UTC

Severity: normal

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>
Cc: 8732 <at> debbugs.gnu.org
Subject: bug#8732: uinttostr: comparison of unsigned expression < 0 is always	false
Date: Wed, 25 May 2011 13:54:54 -0600
[Message part 1 (text/plain, inline)]
On 05/25/2011 01:23 AM, Voelker, Bernhard wrote:
> Hi *,
> 
> building coreutils-8.12 with '--enable-gcc-warnings' fails on my SLES 10.3 server:
> 
>   CC       uinttostr.o
> cc1: warnings being treated as errors
> In file included from uinttostr.c:3:
> anytostr.c: In function 'uinttostr':
> anytostr.c:39: warning: comparison of unsigned expression < 0 is always false

It would be _really_ nice if there were a way to have gcc shut up that
particular warning when it is the result of a macro expansion that first
checks whether an expresssion is signed or unsigned.  That is, gcc is
issuing the warning for 'is_signed(e) ? (e < 0 ? a : b) : b', even
though the 'e < 0' sub-expression is provably dead code for an unsigned
expression and therefore the warning is spurious.  But we don't know how
to shut up gcc.

This also affects recent gnulib lib/intprops.h, so ideas are welcome.

In the meantime, configure with CFLAGS='-Wno-error' to allow warnings to
still be listed but not halt compilation.

-- 
Eric Blake   eblake <at> redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 14 years and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.