cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: sys_nerr warning

From: Joe Halpin <j.p.h_at_comcast.net>
Date: Sun, 04 Apr 2004 16:27:31 -0500

Daniel Stenberg wrote:

>>I'm pretty sure it should be const anyway. This doesn't cause any problems
>>on Solaris 9 either.
>
> But my (somewhat oldish) glibc headers have it non-const... :-(

That was probably an oversight. Something like sys_nerr that never
changes should be const. I suspect that more systems in the future will
be declaring it const as well.

>> * The symbols _sys_errlist and _sys_nerr are not visible in the
>> * LP64 libc. Use strerror(3C) instead.
>
> I could almost have guessed this. So we need to rewrite the Curl_strerror()
> function to avoid using 'sys_nerr' to avoid having to check for it with yet
> another configure test. At least for non-Windows platforms.

Maybe testing for implementations of strerror() that don't check the
value passed to it would be easier? After Googling around a bit I get
the impression that only older systems are guilty of that.

In my ongoing attempt to learn the auto* tools I'll see if I can come up
with a test that checks to see if strerror() core dumps when passed
INT_MIN or something like that.

I suspect that if the implementation checks for it, we don't need to
worry about whether it's there or not.

Joe
Received on 2004-04-04