Opened 4 years ago

Closed 4 years ago

#4589 closed enhancement (fixed)

Disable c asserts when building without "--enable-debug"

Reported by: Algunenano Owned by: Algunenano
Priority: medium Milestone: PostGIS 3.1.0
Component: postgis Version: master
Keywords: Cc:


In our configure we try to disable C asserts when not building in debug mode:

AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug], [Enable debugging code and flags]),

if test $ENABLE_DEBUG -eq 1; then
    AC_DEFINE([PARANOIA_LEVEL], [10], [Enable use of memory checks])
    AC_DEFINE([PARANOIA_LEVEL], [0], [Disable use of memory checks])
    AC_DEFINE([NDEBUG], [0], [Disable C asserts])

I don't know what AC_DEFINE([NDEBUG], [0], [Disable C asserts]) is doing, probably nothing, but I still have asserts enabled in my release builds. I suggest adding -DNDEBUG to the CPPFLAGS directly instead.

I'm considering this as an enhancement since someone might be surprised by the change on the default, but I believe this was the intention all along.

Change History (2)

comment:2 by Raúl Marín <git@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 651add11/git:

Disable C asserts when building without "—enable-debug"

Closes #4589

Note: See TracTickets for help on using tickets.