Re: Re: [PATCH] Compile without warning with gcc's -Wtype-limits, -Wempty-body

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Re: [PATCH] Compile without warning with gcc's -Wtype-limits, -Wempty-body
Дата
Msg-id 50F6C31B.3040308@gmx.net
обсуждение исходный текст
Ответ на Re: [PATCH] Compile without warning with gcc's -Wtype-limits, -Wempty-body  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On 1/15/13 6:36 AM, Andres Freund wrote:
> I just think that the price of fixing a single Assert() that hasn't
> changed in years where the variable isn't likely to ever get signed is
> acceptable.

Well, once you get past that one change you proposed, you will also find

pg_standby.c: In function 'SetWALFileNameForCleanup':
pg_standby.c:348:3: error: comparison of unsigned expression >= 0 is
always true [-Werror=type-limits]

(which, curiously, is the only one that clang complains about).

I don't like removing safety checks from code when there is no other
mechanism that could make up for it somehow.

I think the best practice at the moment, as with most gcc -Wextra
warnings, is to manually check them once in a while.




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: log_lock_waits to identify transaction's relation
Следующее
От: Claudio Freire
Дата:
Сообщение: Re: Parallel query execution