Hi, Compiling postgres I currently get the following warning when compiling without LOCK_DEBUG: /home/andres/src/postgresql/src/backend/storage/lmgr/lock.c:944:52: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] PROCLOCK_PRINT("LockAcquire: NOWAIT", proclock);
It'd be easy to just disable the warning with -Wno-empty-body, but I actually like the warning. It's easy to fix by defining PROCLOCK_PRINT to (void)0 instead of defining it empty when LOCK_DEBUG is enabled. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index f4f32e9..0e5e679 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -331,8 +331,8 @@ PROCLOCK_PRINT(const char *where, const PROCLOCK *proclockP) } #else /* not LOCK_DEBUG */ -#define LOCK_PRINT(where, lock, type) -#define PROCLOCK_PRINT(where, proclockP) +#define LOCK_PRINT(where, lock, type) (void)0 +#define PROCLOCK_PRINT(where, proclockP) (void)0 #endif /* not LOCK_DEBUG */
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers