From owner-cvs-all Mon Mar 15 10: 9:54 1999 Delivered-To: cvs-all@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 01A1014C3C; Mon, 15 Mar 1999 10:09:45 -0800 (PST) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.1/8.9.1) with ESMTP id KAA10163; Mon, 15 Mar 1999 10:08:56 -0800 (PST) (envelope-from jdp@polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.9.2/8.9.1) id KAA17211; Mon, 15 Mar 1999 10:08:55 -0800 (PST) (envelope-from jdp@polstra.com) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <47124.921493522@axl.noc.iafrica.com> Date: Mon, 15 Mar 1999 10:08:55 -0800 (PST) Organization: Polstra & Co., Inc. From: John Polstra To: Sheldon Hearn Subject: Re: cvs commit: src/lib/csu/i386-elf Makefile crtbegin.c crtend. Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, John Polstra , Dmitrij Tejblum Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk Sheldon Hearn wrote: > On Sun, 14 Mar 1999 21:15:57 +0300, Dmitrij Tejblum wrote: > >> Ah! This is the thing that breaks world (namely, groff) with -O3. gcc >> eliminate the "unused" code completely, and you cannot fix it by >> -Wno-unused or by __unused. > > Does this relate at all to PR bin/10522? No, that's something different. It's a known limitation of gcc that some spurious warnings can come out when no optimization is used. (And some constructs that should cause valid warnings can be missed.) That's why it's a bad idea to use -Werror anywhere, any time. I see several possible solutions: 1. Outlaw the use of -Werror in any makefiles under /usr/src, and add a comment warning about its use in /etc/make.conf. 2. Add some magic to the /usr/share/mk/files to silently remove -Werror from CFLAGS if no optimization is used. I'm pretty sure this is feasible, modulo bugs in make. Here's a barely tested possibility: _OFLAG:=-O0 .for i in ${CFLAGS:M-O*} _OFLAG:=${i} .endfor .if ${_OFLAG} == "-O0" CFLAGS:=${CFLAGS:N-Werror} .endif 3. Like #2, but backwards: silently add -O if -Werror is used and no optimization was specified. 4. Modify the compiler to do #2 or #3. I'd personally prefer #1 (because -Werror is a misguided idea IMHO) or #2 (because it solves the problem without police). I don't like #3, because it changes the code that's emitted. I don't like #4, because any divergence from standard compilers is a maintenance hassle. John --- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-interest is the aphrodisiac of belief." -- James V. DeLong To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message