From b541bd5a39b43c11067cf9193020c5fa63df0e65 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Sun, 21 Jun 2009 09:01:12 +0000 Subject: 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@ --- sys/sys/lock.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'sys/sys/lock.h') diff --git a/sys/sys/lock.h b/sys/sys/lock.h index 19d3854..9e47ab4 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 */ -- cgit v1.1