]> Zhao Yanbai Git Server - minix.git/commitdiff
add NOASSERTS make flag that disables assert()s (NDEBUG=1).
authorBen Gras <ben@minix3.org>
Wed, 16 Feb 2011 18:58:30 +0000 (18:58 +0000)
committerBen Gras <ben@minix3.org>
Wed, 16 Feb 2011 18:58:30 +0000 (18:58 +0000)
  . made some checks in vfs/vnode.c also respond to NDEBUG=1.
  . turned on in release builds

servers/vfs/vnode.c
share/mk/bsd.own.mk
tools/chrootmake.sh

index b98ff2572d0a91c8f0479873d3d049119ac1dcc6..9e1a9e03a443a3a9a83a7b43cb5853414a938483 100644 (file)
 #include <minix/vfsif.h>
 
 /* Is vnode pointer reasonable? */
+#if NDEBUG
+#define SANEVP(v)
+#define CHECKVN(v)
+#define ASSERTVP(v)
+#else
 #define SANEVP(v) ((((v) >= &vnode[0] && (v) < &vnode[NR_VNODES])))
 
 #define BADVP(v, f, l) printf("%s:%d: bad vp %p\n", f, l, v)
@@ -29,6 +34,7 @@
 /* vp check that panics */
 #define ASSERTVP(v) if(!SANEVP(v)) { \
        BADVP(v, __FILE__, __LINE__); panic("bad vp"); }
+#endif
 
 /*===========================================================================*
  *                             get_free_vnode                               *
index f8164681710aa94afbdcbf8e56401856c34b2029..724ebdf26f36d14460681ac78181a0f1b8409a12 100644 (file)
@@ -16,6 +16,10 @@ AFLAGS += ${SMP_FLAGS}
 MAKECONF?=     /etc/make.conf
 .-include "${MAKECONF}"
 
+.ifdef NOASSERTS
+CFLAGS += -DNDEBUG=1
+.endif
+
 #
 # CPU model, derived from MACHINE_ARCH
 #
index 4f07698e0d564c41617dc17eae89c4c69dd61fcb..c030dc0597805d5557b650bd87122423008af9dd 100755 (executable)
@@ -8,7 +8,7 @@ then    make $@
        exit $?
 fi
 
-make world
+make NOASSERTS=yes world
 cd tools 
 rm revision
 rm /boot/image/*