Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Apr 2003 20:26:05 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/libexec/talkd announce.c extern.h print.ctable.c talkd.c
Message-ID:  <20030403200459.H30311@gamplex.bde.org>
In-Reply-To: <20030403093800.GA68012@dhcp01.pn.xcllnt.net>
References:  <200304030513.h335DR60079544@repoman.freebsd.org> <20030403055049.GA67232@dhcp01.pn.xcllnt.net> <20030403085350.GA37174@sunbay.com> <20030403093800.GA68012@dhcp01.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 3 Apr 2003, Marcel Moolenaar wrote:

> On Thu, Apr 03, 2003 at 11:53:50AM +0300, Ruslan Ermilov wrote:
> > >
> > How's this bugfix?
> >
> > %%%
> > Index: bsd.sys.mk
> > ===================================================================
> > RCS file: /home/ncvs/src/share/mk/bsd.sys.mk,v
> > retrieving revision 1.12
> > diff -u -r1.12 bsd.sys.mk
> > --- bsd.sys.mk	31 Mar 2003 13:10:51 -0000	1.12
> > +++ bsd.sys.mk	3 Apr 2003 08:48:40 -0000
> > @@ -25,7 +25,7 @@
> >  .  if ${WARNS} > 3
> >  CFLAGS		+=	-Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align
> >  .  endif
> > -.  if ${WARNS} > 4
> > +.  if ${WARNS} > 4 && !empty(CFLAGS:M-O*) && empty(CFLAGS:M-O0)
> >  CFLAGS		+=	-Wuninitialized
> >  .  endif
> >  # BDECFLAGS
> > %%%
>
> Should work in most cases, but beware DEBUG_FLAGS. The above does not
> catch the case where DEBUG_FLAGS is defined to something like "-O0 -g".
> I think this is a reasonable use of DEBUG_FLAGS.
>
> \begin{log}
> dhcp01% setenv DEBUG_FLAGS "-O0 -g"
> dhcp01% setenv CFLAGS -O
> dhcp01% make
> cc -O -mcpu=pentiumpro -I/usr/local/src/fpi/cpu/..  -O0 -g -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wuninitialized  -c decode.c
> cc1: warnings being treated as errors
> cc1: warning: -Wuninitialized is not supported without -O
> *** Error code 1
> \end{log}

The patch works for me, as it should since ${DEBUG_FLAGS} is added to
CFLAGS before including bsd.sys.mk in at least bsd.prog.mk.  Similarly
for COPTS, except it is actually documented in mk/bsd.README.

There are some other minor ordering problems.  -Winitialized is not set
for "-O -O0 -O" in ${CFLAGS}, and there may be hackish makefiles that set
CFLAGS after including <bsd.prog.mk>.

Bruce



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