Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Sep 2007 12:43:11 +1000
From:      Edwin Groothuis <edwin@mavetju.org>
To:        Greg 'groggy' Lehey <grog@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/gnu/usr.bin/man/man man.c
Message-ID:  <20070926024311.GD1384@k7.mavetju>
In-Reply-To: <20070926021827.GO91528@dereel.lemis.com>
References:  <200709252141.l8PLfMGv001982@repoman.freebsd.org> <20070926021827.GO91528@dereel.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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@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@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@mavetju.org    |              Weblog: http://www.mavetju.org/weblog/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070926024311.GD1384>