[Top][All Lists]

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

Re: [PATCH] xstrtol: ensure errno is reset

From: Pádraig Brady
Subject: Re: [PATCH] xstrtol: ensure errno is reset
Date: Wed, 31 Dec 2014 12:12:50 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 31/12/14 07:44, Paul Eggert wrote:
> Pádraig Brady wrote:
>> +2014-12-30  Pádraig Brady<address@hidden>
>> +
>> +    xstrtol: ensure errno is reset
>> +    Since commit 3bf75404, on 26-09-1998, errno may not have been reset.
>> +    Noticed with a spurious coreutils test failure on Darwin 14.0.0.
> Sorry, can you explain more?  First, why does xstrtol's caller care about 
> errno 
> -- isn't that a bug?

Well strtol is documented to return ERANGE in certain cases,
and the coreutils xdectoint wrapper uses and sets errno
to give more accurate diagnostics.

> Second, can't isspace set errno and won't this cause problems?

That would be surprising. At least we have a test in place
for that now.


reply via email to

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