aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/lock.h
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-06-21 09:01:12 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-06-21 09:01:12 +0000
commit20a0556c59332912ec603b3d3164fa9176cec8b6 (patch)
tree04572ff6acc27b683f08d6ed71bcd534579198ed /sys/sys/lock.h
parent2b7d10c225f7a5c9d8ea6864c5df462cf120bb6b (diff)
downloadsrc-20a0556c59332912ec603b3d3164fa9176cec8b6.tar.gz
src-20a0556c59332912ec603b3d3164fa9176cec8b6.zip
In non-debugging mode make this define (void)0 instead of nothing. This
helps to catch bugs like the below with clang. if (cond); <--- note the trailing ; something(); Approved by: ed (mentor) Discussed on: current@
Notes
Notes: svn path=/head/; revision=194578
Diffstat (limited to 'sys/sys/lock.h')
-rw-r--r--sys/sys/lock.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index 19d38548cb59..9e47ab4b41db 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -283,21 +283,21 @@ void witness_thread_exit(struct thread *);
witness_line(lock)
#else /* WITNESS */
-#define WITNESS_INIT(lock, type)
-#define WITNESS_DESTROY(lock)
+#define WITNESS_INIT(lock, type) (void)0
+#define WITNESS_DESTROY(lock) (void)0
#define WITNESS_DEFINEORDER(lock1, lock2) 0
-#define WITNESS_CHECKORDER(lock, flags, file, line, interlock)
-#define WITNESS_LOCK(lock, flags, file, line)
-#define WITNESS_UPGRADE(lock, flags, file, line)
-#define WITNESS_DOWNGRADE(lock, flags, file, line)
-#define WITNESS_UNLOCK(lock, flags, file, line)
+#define WITNESS_CHECKORDER(lock, flags, file, line, interlock) (void)0
+#define WITNESS_LOCK(lock, flags, file, line) (void)0
+#define WITNESS_UPGRADE(lock, flags, file, line) (void)0
+#define WITNESS_DOWNGRADE(lock, flags, file, line) (void)0
+#define WITNESS_UNLOCK(lock, flags, file, line) (void)0
#define WITNESS_CHECK(flags, lock, fmt, ...) 0
-#define WITNESS_WARN(flags, lock, fmt, ...)
-#define WITNESS_SAVE_DECL(n)
-#define WITNESS_SAVE(lock, n)
-#define WITNESS_RESTORE(lock, n)
-#define WITNESS_NORELEASE(lock)
-#define WITNESS_RELEASEOK(lock)
+#define WITNESS_WARN(flags, lock, fmt, ...) (void)0
+#define WITNESS_SAVE_DECL(n) (void)0
+#define WITNESS_SAVE(lock, n) (void)0
+#define WITNESS_RESTORE(lock, n) (void)0
+#define WITNESS_NORELEASE(lock) (void)0
+#define WITNESS_RELEASEOK(lock) (void)0
#define WITNESS_FILE(lock) ("?")
#define WITNESS_LINE(lock) (0)
#endif /* WITNESS */