projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94fedb7
)
ASSERT should evaluate to an expression not a statement.
author
Ben Pfaff
<blp@cs.stanford.edu>
Mon, 18 Oct 2004 17:42:40 +0000
(17:42 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Mon, 18 Oct 2004 17:42:40 +0000
(17:42 +0000)
src/lib/debug.h
patch
|
blob
|
history
diff --git
a/src/lib/debug.h
b/src/lib/debug.h
index 947dff204f17fab746107a8def7b097d23a3db52..76c3f77b732f8aa807847fb9be13a7af91c2bb8d 100644
(file)
--- a/
src/lib/debug.h
+++ b/
src/lib/debug.h
@@
-37,10
+37,8
@@
void debug_backtrace (void);
#undef NOT_REACHED
#ifndef NDEBUG
-#define ASSERT(CONDITION) \
- if (CONDITION) { } else { \
- PANIC ("assertion `%s' failed.", #CONDITION); \
- }
+#define ASSERT(CONDITION) \
+ ((void) ((CONDITION) || PANIC ("assertion `%s' failed.", #CONDITION)))
#define NOT_REACHED() PANIC ("executed an unreachable statement");
#else
#define ASSERT(CONDITION) ((void) 0)