diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-06-21 09:01:12 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-06-21 09:01:12 +0000 |
commit | b541bd5a39b43c11067cf9193020c5fa63df0e65 (patch) | |
tree | 04572ff6acc27b683f08d6ed71bcd534579198ed /sys/sys/lock.h | |
parent | cc5ff80770d96ca4ca6b86009674a097e1f1fc55 (diff) | |
download | FreeBSD-src-b541bd5a39b43c11067cf9193020c5fa63df0e65.zip FreeBSD-src-b541bd5a39b43c11067cf9193020c5fa63df0e65.tar.gz |
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@
Diffstat (limited to 'sys/sys/lock.h')
-rw-r--r-- | sys/sys/lock.h | 26 |
1 files changed, 13 insertions, 13 deletions
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 */ |