Date: Wed, 22 Mar 1995 08:49:26 +0100 (MET) From: J Wunsch <j@uriah.heep.sax.de> To: freebsd-hackers@FreeBSD.org (FreeBSD hackers) Subject: Re: gcc include files Message-ID: <199503220749.IAA13498@uriah.heep.sax.de> In-Reply-To: <Pine.SUN.3.91.950321231322.10430D-100000@mocha.eng.umd.edu> from "Chuck Robey" at Mar 21, 95 11:14:18 pm
next in thread | previous in thread | raw e-mail | index | archive | help
As Chuck Robey wrote: > > > Is just the most annoying declaration in BSD4.4, the correct fix > > is to use strerror. I never do over here, I just go thru the files > > and delete any extern char *sys_errlist[]; > This "fix" to go to const breaks more stuff than you can shake a stick at. > Is it really necessary? No, from the sense of things, the stuff *is* already broken. It should never have declared sys_errlist[] itself (and instead use the declaration from the header file). This bug only got apparent by 4.4BSD correctly declaring the array to consist of constant strings. (The improper duplicate declaration might have been lurking around for years in those programs. You'll only detect it when calling gcc with -Wredundant-decls.) For the question ``Is it really necessary?'': this is probably a matter of taste. What do you like more? A compiler warning/error when trying to modify a constant object (due to an oversight of the programmer), or the core dump at run time? -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503220749.IAA13498>