Re: [Proposal] Level4 Warnings show many shadow vars

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [Proposal] Level4 Warnings show many shadow vars
Дата
Msg-id 12181.1575927484@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [Proposal] Level4 Warnings show many shadow vars  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2019-12-09 11:59:23 -0500, Robert Haas wrote:
>> On Mon, Dec 9, 2019 at 11:48 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> The only thing I think is really a substantial bug risk here is your
>>> point about our own macros referencing our own global variables.
>>> We might be better off fixing that in a localized way by establishing
>>> a policy that any such macros should be converted to static inlines.

>> That would be a lot of work, but it would probably have some side
>> benefits, like making things more type-safe.

> It's also not always possible in C99, as we have plenty macros with
> essentially dynamic types. And there's no typeof() in standard C,
> unfortunately (C11's _Generic can help, but isn't great either).

How much overlap is there between macros referencing global variables
and macros with indeterminate types?  Not much I bet.  I'd mostly
be worried about things like CHECK_FOR_INTERRUPTS().

            regards, tom lane



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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: VACUUM memory management
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [Proposal] Level4 Warnings show many shadow vars