coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cygwin results [was: [platform-testers] new snapshot available: core


From: Eric Blake
Subject: Re: cygwin results [was: [platform-testers] new snapshot available: coreutils-8.22.151-37b36]
Date: Mon, 14 Jul 2014 22:33:59 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 07/14/2014 10:04 PM, Eric Blake wrote:

> Now I'm seeing this with gcc 4.8.3:
> 
>   CC       lib/openat-die.o
> lib/openat-die.c: In function 'openat_save_fail':
> lib/openat-die.c:34:1: error: function might be candidate for attribute
> 'noreturn' [-Werror-suggest-attribute=noreturn]
>  openat_save_faile (int errno)
>  ^

Oops, s/faile/fail/ (not sure how I messed up the copy/paste).  Other
warnings, once I turned -Werror off:

=========
Related to the first, not sure why the analysis is different on cygwin
than it is for Linux, but adding attributes can't hurt.

lib/xstrtol-error.c: In function 'xstrtol_fatal':
lib/xstrtol-error.c:92:1: warning: function might be candidate for
attribute 'noreturn'

src/csplit.c: In function 'xalloc_die':
src/csplit.c:229:1: warning: function might be candidate for attribute
'noreturn'

=============
Here's some real errors:

src/numfmt.c: In function 'simple_strtod_int':
src/numfmt.c:457:3: warning: array subscript has type 'char'
[-Wchar-subscripts]
   while (*endptr && isdigit (**endptr))
   ^
src/numfmt.c: In function 'simple_strtod_human':
src/numfmt.c:603:7: warning: array subscript has type 'char'
[-Wchar-subscrtips]
       while (isblank (**endptr))
       ^
also at line 1177, 1232, 1234

Ouch. isdigit() is fairly safe (because POSIX limits it to returning
true for exactly 10 bytes that can't become negative when promoted to
int), but isblank((int)char) is an absolute bug - there are locales
where isblank(255) != isblank((int)(char)255), because char is signed
and the value promotes to -1 which is indistinguishable from EOF.  Are
you sure this code shouldn't be using gnulib's c_isdgit and c_isblank
instead?  And if you DO want locale comparisons, then use isblank
(to_uchar (**endptr)).

=========

I'm out of time for today, but finally reproduced the libstdbuf.so build
issue on coreutils.git, so I'll resume tomorrow.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]