add NOASSERTS make flag that disables assert()s (NDEBUG=1).
. made some checks in vfs/vnode.c also respond to NDEBUG=1. . turned on in release builds
This commit is contained in:
parent
7840456b77
commit
287fee89cb
3 changed files with 11 additions and 1 deletions
|
@ -16,6 +16,11 @@
|
||||||
#include <minix/vfsif.h>
|
#include <minix/vfsif.h>
|
||||||
|
|
||||||
/* Is vnode pointer reasonable? */
|
/* 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 SANEVP(v) ((((v) >= &vnode[0] && (v) < &vnode[NR_VNODES])))
|
||||||
|
|
||||||
#define BADVP(v, f, l) printf("%s:%d: bad vp %p\n", f, l, v)
|
#define BADVP(v, f, l) printf("%s:%d: bad vp %p\n", f, l, v)
|
||||||
|
@ -29,6 +34,7 @@
|
||||||
/* vp check that panics */
|
/* vp check that panics */
|
||||||
#define ASSERTVP(v) if(!SANEVP(v)) { \
|
#define ASSERTVP(v) if(!SANEVP(v)) { \
|
||||||
BADVP(v, __FILE__, __LINE__); panic("bad vp"); }
|
BADVP(v, __FILE__, __LINE__); panic("bad vp"); }
|
||||||
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* get_free_vnode *
|
* get_free_vnode *
|
||||||
|
|
|
@ -16,6 +16,10 @@ AFLAGS += ${SMP_FLAGS}
|
||||||
MAKECONF?= /etc/make.conf
|
MAKECONF?= /etc/make.conf
|
||||||
.-include "${MAKECONF}"
|
.-include "${MAKECONF}"
|
||||||
|
|
||||||
|
.ifdef NOASSERTS
|
||||||
|
CFLAGS += -DNDEBUG=1
|
||||||
|
.endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# CPU model, derived from MACHINE_ARCH
|
# CPU model, derived from MACHINE_ARCH
|
||||||
#
|
#
|
||||||
|
|
|
@ -8,7 +8,7 @@ then make $@
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make world
|
make NOASSERTS=yes world
|
||||||
cd tools
|
cd tools
|
||||||
rm revision
|
rm revision
|
||||||
rm /boot/image/*
|
rm /boot/image/*
|
||||||
|
|
Loading…
Reference in a new issue