cvs commit: src/gnu/usr.bin/man/man man.c

Edwin Groothuis edwin at mavetju.org
Tue Sep 25 19:43:11 PDT 2007


On Wed, Sep 26, 2007 at 12:18:27PM +1000, Greg 'groggy' Lehey wrote:
> On Tuesday, 25 September 2007 at 21:41:22 +0000, Edwin Groothuis wrote:
> > edwin       2007-09-25 21:41:22 UTC
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     gnu/usr.bin/man/man  man.c
> >   Log:
> >   Fix possible uninitialized variable insert due to previous commit.
> >
> >   Pointy hat to: me and my absence of -Wall in my CFLAGS.
> 
> My recollection was that you accidentally removed -O from the flags,
> and that optimization is needed for the compiler to recognize this
> situation.

Without CFLAGS in my /etc/make.conf (will give -O2 in the run)

    [/home/edwin/cvs/freebsd/src-current/gnu/usr.bin/man/man] root at k7>make clean man.o
    rm -f man.1 man man.o manpath.o glob.o man.1.gz man.1.cat.gz
    cc -O2 -fno-strict-aliasing -pipe  -I/usr/home/edwin/cvs/freebsd/src-current/gnu/usr.bin/man/man/../lib -DHAVE_LIBZ=1 -I/usr/home/edwin/cvs/freebsd/src-current/gnu/usr.bin/man/man/../lib -DSTDC_HEADERS -DPOSIX -DHAS_TROFF -DDO_COMPRESS -DCATMODE=0644  -c man.c

With CFLAGS=-Wall on the command line (will give -Wall in the run, but no -O2)

    [/home/edwin/cvs/freebsd/src-current/gnu/usr.bin/man/man] root at k7>CFLAGS=-Wall make clean man.o
    rm -f man.1 man man.o manpath.o glob.o man.1.gz man.1.cat.gz
    cc -Wall  -I/usr/home/edwin/cvs/freebsd/src-current/gnu/usr.bin/man/man/../lib -DHAVE_LIBZ=1 -I/usr/home/edwin/cvs/freebsd/src-current/gnu/usr.bin/man/man/../lib -DSTDC_HEADERS -DPOSIX -DHAS_TROFF -DDO_COMPRESS -DCATMODE=0644  -c man.c

With CFLAGS+=-Wall in my /etc/make.conf (will give -O2 and -Wall):

    [/home/edwin/cvs/freebsd/src-current/gnu/usr.bin/man/man] root at k7>make clean man.o
    rm -f man.1 man man.o manpath.o glob.o man.1.gz man.1.cat.gz
    cc -O2 -fno-strict-aliasing -pipe -Wall  -I/usr/home/edwin/cvs/freebsd/src-current/gnu/usr.bin/man/man/../lib -DHAVE_LIBZ=1 -I/usr/home/edwin/cvs/freebsd/src-current/gnu/usr.bin/man/man/../lib -DSTDC_HEADERS -DPOSIX -DHAS_TROFF -DDO_COMPRESS -DCATMODE=0644  -c man.c
    man.c: In function `ultimate_source':
    man.c:878: warning: 'end' might be used uninitialized in this function

You are right about needing -Wall *and* -O to get the warnings.

Edwin
-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin at mavetju.org    |              Weblog: http://www.mavetju.org/weblog/


More information about the cvs-src mailing list