From owner-freebsd-hackers Wed Mar 22 00:20:58 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id AAA26702 for hackers-outgoing; Wed, 22 Mar 1995 00:20:58 -0800 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id AAA26665 for ; Wed, 22 Mar 1995 00:20:06 -0800 Received: from sax.sax.de by irz301.inf.tu-dresden.de with SMTP (5.67b+/DEC-Ultrix/4.3) id AA10714; Wed, 22 Mar 1995 08:52:13 +0100 Received: by sax.sax.de (8.6.9/8.6.9-s1) with UUCP id IAA11217 for freebsd-hackers@freebsd.org; Wed, 22 Mar 1995 08:52:12 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.6.11/8.6.9) id IAA13498 for freebsd-hackers@freebsd.org; Wed, 22 Mar 1995 08:49:27 +0100 From: J Wunsch Message-Id: <199503220749.IAA13498@uriah.heep.sax.de> Subject: Re: gcc include files To: freebsd-hackers@FreeBSD.org (FreeBSD hackers) Date: Wed, 22 Mar 1995 08:49:26 +0100 (MET) In-Reply-To: from "Chuck Robey" at Mar 21, 95 11:14:18 pm Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1136 Sender: hackers-owner@FreeBSD.org Precedence: bulk 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. ;-)