NDEBUG and assert()

Erik Cederstrand erik at cederstrand.dk
Wed Sep 19 10:18:03 UTC 2012


Den 19/09/2012 kl. 11.19 skrev Erik Cederstrand <erik at cederstrand.dk>:

> The below below patch will let the analyzer reason correctly about the code, and removes the report mentioned above (and a handful others in ncurses). It doesn't touch contrib code, but I'm not happy about changing include/assert.h since it's used so many other places. Any other ideas for how to best solve this?

An alternative that doesn't touch assert.h but contains a patch to /contrib:

Erik


Index: lib/ncurses/ncurses/ncurses_cfg.h
===================================================================
--- lib/ncurses/ncurses/ncurses_cfg.h	(revision 240638)
+++ lib/ncurses/ncurses/ncurses_cfg.h	(working copy)
@@ -145,7 +145,6 @@
 #define NCURSES_NO_PADDING 1
 #define NCURSES_PATHSEP ':'
 #define NCURSES_VERSION_STRING "5.7.20081102"
-#define NDEBUG 1
 #define RETSIGTYPE void
 #define SIG_ATOMIC_T volatile sig_atomic_t
 #define SIZEOF_SIGNED_CHAR 1
Index: lib/ncurses/config.mk
===================================================================
--- lib/ncurses/config.mk	(revision 240638)
+++ lib/ncurses/config.mk	(working copy)
@@ -27,8 +27,6 @@
 
 CFLAGS+=	-Wall
 
-CFLAGS+=	-DNDEBUG
-
 CFLAGS+=	-DHAVE_CONFIG_H
 
 # everyone needs this
Index: contrib/ncurses/include/ncurses_defs
===================================================================
--- contrib/ncurses/include/ncurses_defs	(revision 240638)
+++ contrib/ncurses/include/ncurses_defs	(working copy)
@@ -171,7 +171,6 @@
 NCURSES_EXT_FUNCS
 NCURSES_NO_PADDING
 NCURSES_PATHSEP	':'
-NDEBUG
 NEED_PTEM_H
 NO_LEAKS
 PURE_TERMINFO



More information about the freebsd-hackers mailing list