[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Patch] Enable NDEBUG in release mode on Windows (Was: Re: [RFC] Replacement for "assert" in the libraries)

From: Daniel Shahaf <d.s_at_daniel.shahaf.co.il>
Date: Sat, 14 Jun 2008 19:55:05 +0300 (Jerusalem Daylight Time)

Bert Huijben (TCG) wrote on Sat, 14 Jun 2008 at 00:47 +0200:
> Hi,
>
> > -----Original Message-----
> > From: Stefan Sperling [mailto:stsp_at_elego.de]
> > Sent: vrijdag 13 juni 2008 21:18
> > To: dev_at_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 <tortoisesvn_at_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.huijben_at_competence.biz>
> ]]

r31733, thanks.

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-06-14 18:55:22 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.