[Top][All Lists]

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

[bug-gnulib] Re: iconv made easy

From: Paul Eggert
Subject: [bug-gnulib] Re: iconv made easy
Date: Tue, 28 Dec 2004 21:35:53 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Simon Josefsson <address@hidden> writes:

>> Perhaps you should rewrite it to remove have_error, and consistently
>> use the test "save_errno == 0" instead of "!have_error".  That will
>> simplify the code a bit.
> Is that reliable?  I though that errno could be left alone (i.e., left
> as garbage) when a system function succeeds.

errno might be garbage, but save_errno would not be garbage.  It would
reliably be zero when the function started, because you would
initialize it to zero; this would take the place of initializing
have_error to 0.

It's a minor point -- it does't affect correctness, just clarity
(and perhaps efficiency, a tad).

> OTOH, the function start out by doing 'errno = 0'.

Yes, that's what I meant, except you'd initialize save_errno instead
of errno.

reply via email to

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