Re: Implementation errors in strtol()

From: Giorgos Keramidas <keramida_at_freebsd.org>
Date: Mon, 24 Jan 2005 00:16:30 +0200
On 2005-01-24 00:16, Andrey Chernov <ache_at_nagual.pp.ru> wrote:
>On Sun, Jan 23, 2005 at 04:30:24PM +0200, Giorgos Keramidas wrote:
>> Why would checking for explicit errno values be necessary?  IIRC, after
>> a few emails I had exchanged with Dima Dorfman a few months ago,
>> checking for endptr *and* errno != 0 was ok.
>
> _Portable_ application must suppose that not all OSes are POSIX
> conformant, so it can't be sure what errno comes from strtol(), it is why
> explicit checking for known value is needed.

If errno is explicitly set (i.e. zeroed) by the calling program
immediately before strtol(), can we not be sure that it was, in fact,
strtol() that set it to any non-zero value?
Received on Sun Jan 23 2005 - 21:16:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:26 UTC