On 3/27/19 10:56 PM, Ken Moffat via blfs-dev wrote:

[snip]

Compared to meson, a much greater use of -DNDEBUG.  I have no idea
if CFLAGS, CXXFLAGS supplied in the environment override these
options.

But I think we ought to have something in Notes on Building Software
about the cmake defaults, and I'm assuming that -DNDEBUG similarly
disables runtime assertions which can slow the programs or libraries
down if they ar present.

Confirming.

$ man assert
...
If expression is false (i.e., compares equal to zero), assert() prints an error message to standard error and terminates the program by calling abort(3).
...
If the macro NDEBUG is defined at the moment <assert.h>  was  last
included, the  macro  assert() generates no code, and hence does nothing
at all. It is not recommended to define NDEBUG if using assert() to detect error conditions since the software may behave non-deterministically.
========
We probably do NOT want to disable asserts when running tests, so it gets complicated.

  -- Bruce
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to