This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] don't reset errno if no error occured
On 07/12/2010 08:14 PM, Jonathan Wakely wrote:
> On 12 July 2010 17:43, Paolo Carlini wrote:
>
>> In that case, we could just remove 'errno = 0' for the GNU/Linux targets
>> we (Matthias too) care about via a __GLIBC__ macro check, and everyone
>> we'll be happy.
>>
> It would be even better to make that change for all POSIX systems, not
> just glibc.
>
Of course, but the problem is we don't have a simple macro to check for
that. We could include __GLIBC__ and more systems when confirmed to be safe.
> That said, the bug report is bogus, the doc saying "errno is never set
> to zero by any system call or library function" is not referring to
> C++ library functions.
>
Sure, sure, I was only thinking that it would be nice to simplify a bit
that code by avoiding a redundant errno = 0, if at all possible.
Paolo.