Re: lots of unused variable warnings in assert-free builds

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: lots of unused variable warnings in assert-free builds
Дата
Msg-id 7788.1326609479@sss.pgh.pa.us
обсуждение исходный текст
Ответ на lots of unused variable warnings in assert-free builds  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: lots of unused variable warnings in assert-free builds  (Andrew Dunstan <andrew@dunslane.net>)
Re: lots of unused variable warnings in assert-free builds  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> I see that in some places our code already uses #ifdef
> USE_ASSERT_CHECKING, presumably to hide similar issues.  But in most
> cases using this would significantly butcher the code.  I found that
> adding __attribute__((unused)) is cleaner.  Attached is a patch that
> cleans up all the warnings I encountered.

Surely this will fail entirely on most non-gcc compilers?  Not to
mention that next month's gcc may complain "hey, you used this 'unused'
variable".  I think #ifdef USE_ASSERT_CHECKING is really the only way
if you care about quieting these warnings.  (Personally, I don't.)
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: foreign key locks, 2nd attempt
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Our poll() based WaitLatch implementation is broken