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.


Reply via email to