Re: simplehash.h: "SH_SCOPE static" causes warnings

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: simplehash.h: "SH_SCOPE static" causes warnings
Дата
Msg-id CA+TgmoZBhb6qDZ=0ttHgHL9w4ZJr9eFiO_V=pDTf-_YFX43B7Q@mail.gmail.com
обсуждение исходный текст
Ответ на [MASSMAIL]simplehash.h: "SH_SCOPE static" causes warnings  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: simplehash.h: "SH_SCOPE static" causes warnings  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
On Tue, Apr 9, 2024 at 2:10 PM Jeff Davis <pgsql@j-davis.com> wrote:
> If using "SH_SCOPE static" with simplehash.h, it causes a bunch of
> warnings about functions that are defined but not used. It's simple
> enough to fix by appending pg_attribute_unused() to the declarations
> (attached).

Hmm. I'm pretty sure that I've run into this problem, but I concluded
that I should use either "static inline" or "extern" and didn't think
any more of it. I'm not sure that I like the idea of just ignoring the
warnings, for fear that the compiler might not actually remove the
code for the unused functions from the resulting binary. But I'm not
an expert in this area either, so maybe I'm wrong.

--
Robert Haas
EDB: http://www.enterprisedb.com



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: macOS Ventura won't generate core dumps
Следующее
От: Andres Freund
Дата:
Сообщение: Re: simplehash.h: "SH_SCOPE static" causes warnings