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

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



Mikko Larjava <mitala@nic.funet.fi> writes:

|> On Thu, 12 Feb 1998, Yves Pelletier wrote:
|>> > char const *const sys_errlist[];
|>> Ok... that is what I will do, unless  someone tells me that 
|>> in non-mbaserel cases this definition causes unwanted effects in
|>> the assembly code.
|>> 
|>> Another thing: the way the return statement is written in
|>> strerror(), just:
|>> 
|>> 	return(sys_errlist[errnum]);
|>> 
|>> causes gcc to issue a warning about the const type being
|>> dropped.  It's unlikely to be a serious problem, but how should
|>> it be written to keep the compiler happy? 

|> Declare strerror() as 

|> const char *strerror(int)

You can't, the standard says `char *strerror(int)'.  The only option we
have is to throw in a cast.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"
schwab@gnu.org