Re: cvs commit: src/share/mk bsd.lib.mk bsd.prog.mk

[ Available lists | Index of cvs-all | Month of Sep 2006 | Week of 13 Sep 2006 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Juli Mallett <jmallett@FreeBSD.org>
Date
13 Sep 2006 23:32:11
Subject
Re: cvs commit: src/share/mk bsd.lib.mk bsd.prog.mk
Message-ID
20060913233211.GA83839@toxic.magnesium.net


[ Hide this part ]
Hi David,

* "David E. O'Brien" <obrien@FreeBSD.org> [ 2006-09-13 ]
[ cvs commit: src/share/mk bsd.lib.mk bsd.prog.mk ]
> When building WITHOUT_ASSERT_DEBUG, we need to disable -Werror as its easy
> to see "warning: unused variable `foo'".

I think it might be a better idea to -Wno-unused, since the only sorts of
warnings one wants to ignore building NDEBUG are the variables which are
otherwise unused. For example, if someone does something like:

int foo;

assert((foo = some_function()) != 0);
printf("got foo=%d\n", foo);

We *really* want to have that warning be an error, as foo is being used
uninitialized, and the code is broken.

Thanx,
juli.


Elapsed time: 0.126 seconds