[postgis-tickets] [PostGIS] #4589: Disable c asserts when building without "--enable-debug"

PostGIS trac at osgeo.org
Sat Nov 23 06:32:25 PST 2019


#4589: Disable c asserts when building without "--enable-debug"
-------------------------+---------------------------
 Reporter:  Algunenano   |      Owner:  Algunenano
     Type:  enhancement  |     Status:  assigned
 Priority:  medium       |  Milestone:  PostGIS 3.1.0
Component:  postgis      |    Version:  master
 Keywords:               |
-------------------------+---------------------------
 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]),
         [ENABLE_DEBUG=1], [ENABLE_DEBUG=0])

 if test $ENABLE_DEBUG -eq 1; then
     AC_DEFINE([PARANOIA_LEVEL], [10], [Enable use of memory checks])
     CFLAGS="$CFLAGS -g"
 else
     AC_DEFINE([PARANOIA_LEVEL], [0], [Disable use of memory checks])
     AC_DEFINE([NDEBUG], [0], [Disable C asserts])
 fi
 }}}


 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.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4589>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list