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

Re: sys_errlist (Re: gcc (Re: porting?))



On Tue, 10 Feb 1998, Yves Pelletier wrote:
> In function  strerror(), sys_errlist is declared:
> 
> #ifndef __MBASE__
>         extern char const *const sys_errlist[];
> #else
>         extern char const *sys_errlist[];
> #endif

Any reason why this has to be done because the variable is declared 
inside strerror.c?

> but in PL46/47 MiNTlib, the initial array declaration at the
> beginning of strerror.c is simply: 
> 
> char *sys_errlist[] = 
> 	{ ...
> 	     }
> 
> In PL48 if have ifdef'd it so that it comforms to the "extern"
> declaration in the function.  I did this rather blindly... so I
> would appreciate corrections if necessary. 

The best sould be if I'm asked to just declare it 

char const *const sys_errlist[];

everywhere. The problem is that if it is used in baserel program it has 
to have a right declaration. If it is declared diffrently or used without 
declaration (?) linker fives a few nice errors. Any ideas anyone? Is the 
array really needed to be global or could it just be static inside 
strerror.c? The point of having both strerror() and the array is not 
clear for me.