You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Bert Huijben (TCG)" <b....@competence.biz> on 2008/06/13 22:47:05 UTC
[Patch] Enable NDEBUG in release mode on Windows (Was: Re: [RFC] Replacement for "assert" in the libraries)
Hi,
> -----Original Message-----
> From: Stefan Sperling [mailto:stsp@elego.de]
> Sent: vrijdag 13 juni 2008 21:18
> To: dev@subversion.tigris.org
> Subject: Re: [RFC] Replacement for "assert" in the libraries
>
> On Fri, Jun 13, 2008 at 01:07:00PM -0400, Karl Fogel wrote:
> > Stefan K??ng <to...@gmail.com> writes:
> > >> * assert should only be used for "this can't happen" sanity
> checks
> > >
> > > I disagree: assert should *never* be used, unless it's enclosed in
> > > #ifdef _DEBUG statements.
> >
> > assert() is a no-op if NDEBUG is defined. Is NDEBUG defined in our
> > production code? If not, shouldn't it be?
>
> AFAIK, we do build without -NDEBUG by default.
>
> We used to never define -DNDEBUG. I changed our configure script
> to define -DNDEBUG when --disabled-debug is passed, in this commit:
> -----------------------------------------------------------------------
> -
> r31121 | stsp | 2008-05-11 11:44:08 +0200 (Sun, 11 May 2008) | 37 lines
>
> Remove assertions and other debugging code ifdef'd with
> NDEBUG if debugging is not enabled at compile time.
> So far, this code was always compiled in, even in releases.
<snip>
> * configure.ac: Compile with -DNDEBUG if debugging is off.
[[
Follow up to r31121: declare NDEBUG when building in release mode on
Windows.
* build/generator/gen_win.py
(get_win_defines): append NDEBUG define when configuration is 'Release'
Patch by: Bert Huijben <b....@competence.biz>
]]
Bert