[PATCH] warning: suggest braces around empty body in an 'else' statement

Поиск
Список
Период
Сортировка
Искать
От
Andres Freund
Тема
[PATCH] warning: suggest braces around empty body in an 'else' statement
Дата
Msg-id
20131107230039.GK28314@alap2.anarazel.de
Список
Дерево обсуждения
[PATCH] warning: suggest braces around empty body in an 'else' statement Andres Freund <andres@2ndquadrant.com>
Re: [PATCH] warning: suggest braces around empty body in an 'else' statement Tom Lane <tgl@sss.pgh.pa.us>
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
В списке pgsql-hackers по дате отправления
От: Peter Eisentraut
Дата:
Сообщение: Re: Using indices for UNION.
От: Joshua D. Drake
Дата:
FAQ