[Bug 279443] LIBCPP assertions are enabled in optimized builds when -DNDEBUG is given to clang

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 23 Jul 2024 03:17:50 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279443

--- Comment #15 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to huanghwh from comment #14)

FYI for folks reading the diff that might want to know the symbolic
names for the 2 vs. 16:

/usr/include/c++/v1/__config:#  define _LIBCPP_HARDENING_MODE_NONE      (1 <<
1)
/usr/include/c++/v1/__config:#  define _LIBCPP_HARDENING_MODE_FAST      (1 <<
2)
/usr/include/c++/v1/__config:#  define _LIBCPP_HARDENING_MODE_EXTENSIVE (1 <<
4) // Deliberately not ordered.
/usr/include/c++/v1/__config:#  define _LIBCPP_HARDENING_MODE_DEBUG     (1 <<
3)

In symbolic terms:

So the diff changes: _LIBCPP_HARDENING_MODE_EXTENSIVE
into:                _LIBCPP_HARDENING_MODE_NONE


Notes:

That change is not a good match to unoptimized/debug builds.

No single value is generally appropriate. May be something
like the default values for _LIBCPP_HARDENING_MODE (for
libc++ vintages based on such) being branch based:

main (a.k.a. CURRENT) : _LIBCPP_HARDENING_MODE_EXTENSIVE
stable/* , releng/*.* : _LIBCPP_HARDENING_MODE_NONE

If some other value is desired for a context: Be explicit,
causing (for some ?????):
-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_?????

-- 
You are receiving this mail because:
You are the assignee for the bug.