[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++, assert and NDEBUG

From: Braden McDaniel
Subject: Re: C++, assert and NDEBUG
Date: Sun, 28 Mar 2010 21:50:39 -0400

On Sat, 2010-03-27 at 15:03 +0000, Steve Searle wrote: 
> I have started using autotools for the C++ applications I create (very
> much as an amateur). I typically use assert statements during
> development, and would disable these by using -DNDEBUG when the release
> version is built. How should I configure things so that when a user
> installs from the tarball they compile by default with the -DNDEBUG
> option?

The conventional way that should work for sane packages is:

        $ ./configure CPPFLAGS=-DNDEBUG

By convention, NDEBUG is *not* the default.  To make it otherwise
violates the principle of least surprise.

Braden McDaniel <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]