[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#8732: uinttostr: comparison of unsigned expression < 0 is always
Re: bug#8732: uinttostr: comparison of unsigned expression < 0 is always false
Thu, 26 May 2011 10:34:53 +0200
Eric Blake wrote:
> [adding bug-gnulib]
> On 05/25/2011 03:29 PM, Eric Blake wrote:
>>>> 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
>>> the warning is spurious. But we don't know how
>>> to shut up gcc.
>> You're not the first to hit this, either:
>> Since our party line back then was to "upgrade gcc or quit using -Werror
>> with old gcc", I'm marking this as a wontfix; but if you can come up
>> with a patch, we can reopen it.
> Jim, Paul,
> This patch silences the gcc warning even for gcc too old to honor the
> pragma, but I can't help but feel that it might be too gross (it makes
> functions like uinttostr larger in size). What do you think?
Thanks for investigating, but
SLES 10.3's gcc is too old for --enable-gcc-warnings.
Coreutils' documentation (this originated as a report against
coreutils) is clear that you should use the --enable-gcc-warnings
option only with a "very recent version of gcc":
[*] The --enable-gcc-warnings option is useful only with glibc
and with a very recent version of gcc. You'll probably also have
to use recent system headers. If you configure with this option,
and spot a problem, please be sure to send the report to the bug
reporting address of this package, and not to that of gnulib, even
if the problem seems to originate in a gnulib-provided file.
The solution is not to enable those warnings on anything but
"new enough" gcc+glibc.
I've closed the coreutils ticket.