Subject: Re: sys_errlist problems (NetBSD-1.0)
To: Max Bell <mbell@teleport.com>
From: Nick Cuccia <cuccia@remarque.berkeley.edu>
List: port-i386
Date: 01/28/1995 16:16:50
On Fri, 27 Jan 1995 22:14:55 -0800  Max Bell wrote:
>> It means "sys_errlist" was declared in /usr/include/stdio.h to be of a
>> different type than that implied in xv.h.  In this case, the stdio.h
>> declaration is for type extern const char *const sys_errlist[] (according
>> to grep :-).  The statement at line 167 in xv.h must either explicitly
>> declare sys_errlist to be some other type or imply it by context.  If you
>> change xv.h's declaration to match stdio.h's it should stop complaining
>> (about that error, anyway).

This fix is already in xv-3.10.

The Right Thing To Do here is probably to eschew use of sys_errlist in favor of
strerror().  Since the latter is mandated as part of the ANSI/ISO C standard,
you can use __STDC__ rather than __NetBSD__ to hack out/graft in code, making
the hack/graft much more portable.  strerror() takes an integer error value
as an argument and returns a pointer to a string containing the error message.

This is not just a portability win; if I18N is a concern, it's an I18N win as
well, since strerror() uses the locale mechanism to determine what the
appropriate message should be.

--Nick