Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Jun 2024 03:21:17 +0000
From:      bugzilla-noreply@freebsd.org
To:        toolchain@FreeBSD.org
Subject:   [Bug 279443] LIBCPP assertions are enabled in optimized builds when -DNDEBUG is given to clang
Message-ID:  <bug-279443-29464-JkueUQfouT@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-279443-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-279443-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D279443

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

Testing -D_LIBCPP_HARDENING_MODE=3D_LIBCPP_HARDENING_MODE_NONE for the
code having:

            std::copy(
                &buf[0],
                &buf[cb], // !!! ASSERTs HERE !!!
                //&buf[0] + cb,
                std::back_inserter(r)
            );

# c++ -g -D_LIBCPP_HARDENING_MODE=3D_LIBCPP_HARDENING_MODE_NONE
get_executable_filename.cpp
# gdb a.out
. . .
Reading symbols from a.out...
(gdb) run
Starting program: /usr/home/root/c_tests/a.out=20
/usr/home/root/c_tests/a.out
[Inferior 1 (process 66950) exited normally]

In a more general context you might need both -DNDEBUG for the non-libc++ c=
ode
and
also the -D_LIBCPP_HARDENING_MODE=3D_LIBCPP_HARDENING_MODE_NONE for the lib=
c++
code that is involved for one compile command.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-279443-29464-JkueUQfouT>