cvs commit: src/libexec/talkd announce.c extern.h print.c
table.c talkd.c
Ruslan Ermilov
ru at FreeBSD.org
Fri Apr 4 02:55:06 PST 2003
On Fri, Apr 04, 2003 at 08:10:34PM +1000, Bruce Evans wrote:
> On Thu, 3 Apr 2003, David O'Brien wrote:
>
> > 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 += -Wuninitialized
> > > . endif
> >
> > Why not just get rid of it totally? We have this already:
>
> It's too useful to remove totally.
>
> > . if ${WARNS} > 1 && ${WARNS} < 5
> > # XXX Delete -Wuninitialized by default for now -- the compiler doesn't
> > # XXX always get it right.
> > CFLAGS += -Wno-uninitialized
> > . endif
> >
> > so we already know it is problematic. OR rather than use:
> >
> > . if ${WARNS} > 4
> > CFLAGS += -Wuninitialized
> > . endif
> >
> > use
> >
> > . if ${WARNS} == 4
> > CFLAGS += -Wuninitialized
> > . endif
>
> 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 ${CFLAGS}.
> 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 sources
> "to keep gcc happy".
>
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="-O -pipe" make WARNS=5 a.o
: rm -f a a.o
: cc -O -pipe -march=pentiumpro -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-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="-pipe" make WARNS=5 a.o
: rm -f a a.o
: cc -pipe -march=pentiumpro -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -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="-O -Wall -pipe -O0" make WARNS=5 a.o
: rm -f a a.o
: cc -O -Wall -pipe -O0 -march=pentiumpro -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -c a.c
Cheers,
--
Ruslan Ermilov Sysadmin and DBA,
ru at sunbay.com Sunbay Software AG,
ru at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20030404/73f30fc1/attachment.bin
More information about the cvs-src
mailing list