Date: Fri, 4 Apr 2003 13:54:33 +0300 From: Ruslan Ermilov <ru@FreeBSD.org> To: Bruce Evans <bde@zeta.org.au> Cc: Marcel Moolenaar <marcel@xcllnt.net> Subject: Re: cvs commit: src/libexec/talkd announce.c extern.h print.c table.c talkd.c Message-ID: <20030404105433.GB14607@sunbay.com> In-Reply-To: <20030404200159.J33842@gamplex.bde.org> References: <200304030513.h335DR60079544@repoman.freebsd.org> <20030402231638.A81523@FreeBSD.org> <20030403055049.GA67232@dhcp01.pn.xcllnt.net> <20030403180026.A29934@gamplex.bde.org> <20030403085350.GA37174@sunbay.com> <20030403155917.GC17860@dragon.nuxi.com> <20030404200159.J33842@gamplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--V0207lvV8h4k8FAm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 04, 2003 at 08:10:34PM +1000, Bruce Evans wrote: > On Thu, 3 Apr 2003, David O'Brien wrote: >=20 > > On Thu, Apr 03, 2003 at 11:53:50AM +0300, Ruslan Ermilov wrote: > > > -. if ${WARNS} > 4 > > > +. if ${WARNS} > 4 && !empty(CFLAGS:M-O*) && empty(CFLAGS:M-O0) > > > CFLAGS +=3D -Wuninitialized > > > . endif > > > > Why not just get rid of it totally? We have this already: >=20 > It's too useful to remove totally. >=20 > > . if ${WARNS} > 1 && ${WARNS} < 5 > > # XXX Delete -Wuninitialized by default for now -- the compiler doe= sn't > > # XXX always get it right. > > CFLAGS +=3D -Wno-uninitialized > > . endif > > > > so we already know it is problematic. OR rather than use: > > > > . if ${WARNS} > 4 > > CFLAGS +=3D -Wuninitialized > > . endif > > > > use > > > > . if ${WARNS} =3D=3D 4 > > CFLAGS +=3D -Wuninitialized > > . endif >=20 > Add -Wno-uninitialized to cancel -Wuninitialized being part of -Wall as > necessary, i.e., if -Wall is added (${WARNS} > 1) but -O is not in ${CFLA= GS}. > Don't add it or change WARNS settings back and forth to work around bitrot > from -Wuninitialized not being turned off for so long. Don't change sour= ces > "to keep gcc happy". >=20 I've just committed a superior fix. :-) The story is that if have -O, then -Wall (that is true for WARNS > 1) will add -Wuninitialized for you automatically, so there was no point in adding it explicitly in rev. 1.7. : $ make clean; env CFLAGS=3D"-O -pipe" make WARNS=3D5 a.o : rm -f a a.o : cc -O -pipe -march=3Dpentiumpro -Wsystem-headers -Werror -Wall -Wno-for= mat-y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wretur= n-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -c a.c : cc1: warnings being treated as errors : a.c: In function `main': : a.c:6: warning: `a' might be used uninitialized in this function : *** Error code 1 : $ make clean; env CFLAGS=3D"-pipe" make WARNS=3D5 a.o : rm -f a a.o : cc -pipe -march=3Dpentiumpro -Wsystem-headers -Werror -Wall -Wno-format= -y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-t= ype -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -c a.c And just to demonstrate that things don't depend on the options order: : $ make clean; env CFLAGS=3D"-O -Wall -pipe -O0" make WARNS=3D5 a.o : rm -f a a.o : cc -O -Wall -pipe -O0 -march=3Dpentiumpro -Wsystem-headers -Werror -Wal= l -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-ari= th -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align= -c a.c Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --V0207lvV8h4k8FAm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+jWRpUkv4P6juNwoRApLrAJ40AsFhHLHstJ8ezT4nJkWRLViKzwCbBonV MOgdPF43zqe7aEkJvAO2udc= =EwOW -----END PGP SIGNATURE----- --V0207lvV8h4k8FAm--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030404105433.GB14607>