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

Re: strerror() and PL48



On Thu, 21 May 1998, Guido Flohr wrote:

> On Wed, May 20, 1998 at 11:14:41AM +0200, Andreas Schwab wrote:
> > |> static char nullstr[] = "unknown error"
> > 
> > |> to:
> > 
> > |> char const nullstr[] = "unknown error"
> > 
> > |> and casting the return value back to (char *).
> > 
> > You should restore the `static'.

Done.

> 
> At least rename it to _nullstr to avoid namespace pollution (or was the
> missing const the problem?).

The variable name _is_ _nullstr, I just made a typo.  The
problem was with the missing const. Without it, the type of
_nullstr is inconsistent with the other elements of sys_errlist.
Since I did this, I also changed the declaration of
_sock_errlist to make it consistent with sys_errlist. 

I also noticed that in strerror(), sys_errlist is declared as an
extern variable (no problem there) but _sock_errlist is not
declared, even though it is used.  Somehow it still seems to
compile fine, but I added an "ifdef __MINT__"'d declaration of
extern _sock_errlist, etc, at the beginning of the function.  Do
I need to declare _nullstr, or is that implicit?

Thanks for looking over my shoulder. (They shouldn't let
enthusiastic raw recruits play with rocket launchers ;-> ...) 

Yves