|
From: | Paul Eggert |
Subject: | Re: [PATCH] xstrtol: ensure errno is reset |
Date: | Wed, 31 Dec 2014 07:34:03 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
Pádraig Brady wrote:
strtol is documented to return ERANGE in certain cases, and the coreutils xdectoint wrapper uses and sets errno to give more accurate diagnostics.
Sure, but this is xstrtol, not strtol. xstrtol returns its error indicator as a strtol_error value. It would be weird to insist that xstrtol must also set errno. If there's some finer-grained error indication that xdectoint needs from xstrtol, this should be fixed by adding new values to enum strtol_error.
Second, can't isspace set errno and won't this cause problems?That would be surprising.
I've been surprised before. :-) Perhaps isspace, the first time it's called, reads a table from somewhere.
[Prev in Thread] | Current Thread | [Next in Thread] |