[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++, assert and NDEBUG
From: |
Eric Blake |
Subject: |
Re: C++, assert and NDEBUG |
Date: |
Mon, 29 Mar 2010 10:18:35 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3 |
On 03/28/2010 11:07 PM, William Pursell wrote:
> You shouldn't. You have 2 reasonable choices:
> 1) Invoke AC_HEADER_ASSERT in configure.ac, giving the
> user the option to pass --disable-assert to configure.
> 2) Do nothing, and allow the user to pass CPPFLAGS=-DNDEBUG
> to configure.
>
> You might choose to set -DNDEBUG in AM_CPPFLAGS, but
> it really is best to let the user do it. If you want
> to ensure that assertions are disabled in binary
> builds, then add the appropriate argument to the
> configure invocation in the build file (eg, debian/rules
> or a spec file).
Another way is to use the gnulib module assert, which adds the option
'./configure --disable-assert' automatically. But again, on the
principle that the user should choose to disable it, not the package
force NDEBUG as a default.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- C++, assert and NDEBUG, Steve Searle, 2010/03/27
- Re: C++, assert and NDEBUG, Bob Friesenhahn, 2010/03/27
- Re: C++, assert and NDEBUG, Rhys Ulerich, 2010/03/27
- Re: C++, assert and NDEBUG, Braden McDaniel, 2010/03/28
- Re: C++, assert and NDEBUG, William Pursell, 2010/03/29
- Re: C++, assert and NDEBUG,
Eric Blake <=