New compiler warning from btree dedup code

Поиск
Список
Период
Сортировка
От Tom Lane
Тема New compiler warning from btree dedup code
Дата
Msg-id 3171401.1649275153@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: New compiler warning from btree dedup code
Список pgsql-hackers
I just noticed that if I build without asserts on my Mac laptop
(using Apple's latest clang, 13.1.6) I get

nbtdedup.c:68:8: warning: variable 'pagesaving' set but not used [-Wunused-but-set-variable]
        Size            pagesaving = 0;
                        ^
1 warning generated.

Apparently, late-model clang can figure out that the variable
is incremented but not otherwise used.  This is enough to
shut it up, but I wonder if you have another preference:

-   Size        pagesaving = 0;
+   Size        pagesaving PG_USED_FOR_ASSERTS_ONLY = 0;

            regards, tom lane



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

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: New compiler warning from btree dedup code