Re: lots of unused variable warnings in assert-free builds
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: lots of unused variable warnings in assert-free builds |
| Дата | |
| Msg-id | 9212.1327428230@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: lots of unused variable warnings in assert-free builds (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: lots of unused variable warnings in assert-free builds
|
| Список | pgsql-hackers |
I wrote:
> Also, it occurs to me that an intermediate macro
> "PG_USED_FOR_ASSERTS_ONLY" would be a good idea, first because it
> documents *why* you want to mark the variable as possibly unused,
> and second because changing the macro definition would provide an easy way
> to check for totally-unused variables, in case we wanted to periodically
> make such checks.
Uh, wait a second. Why not
#ifdef USE_ASSERT_CHECKING
#define PG_USED_FOR_ASSERTS_ONLY
#else
#define PG_USED_FOR_ASSERTS_ONLY __attribute__((unused))
#endif
Then, when you build with asserts on, you *automatically* get told
if the variable is entirely unused.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера