Re: C++, assert and NDEBUG

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

 



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   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux