Andres Freund <and...@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 <t...@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


Reply via email to