[Top][All Lists]

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

Re: C++, assert and NDEBUG

From: Bob Friesenhahn
Subject: Re: C++, assert and NDEBUG
Date: Sat, 27 Mar 2010 11:50:37 -0500 (CDT)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

On Sat, 27 Mar 2010, 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

Do you actually see a performance difference from adding -DNDEBUG? In GraphicsMagick (which uses many assertions) I did not see a tangible performance difference so I did not worry about it.

The Autoconf default is already to compile with debug enabled so it seems that leaving assertions enabled by default is also a reasonable default.

Bob Friesenhahn
GraphicsMagick Maintainer,

reply via email to

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