Re: Safer hash table initialization macro

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Safer hash table initialization macro
Date: 2025-12-09 10:43:01
Message-ID: CAGECzQTTQGr9cnqGzEUt3FdROc8PwxXjqBD=ere5YiA2A+PvNw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 9 Dec 2025 at 10:11, Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> > What about relying on the existing __builtin_types_compatible_p() instead of
> > _Generic() here?
>
> If we used standard C/C++ it'd work on MSVC too.

And to be clear, that's important because the result of
pg_expr_has_type_p fundamentally impacts the meaning of the code (i.e.
it determines the hash function). Our existing usage of
__builtin_types_compatible_p only adds some *optional* type checking,
so for that it's not critical that it works on MSVC too.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2025-12-09 10:45:11 Re: Safer hash table initialization macro
Previous Message Ajin Cherian 2025-12-09 10:33:59 Re: Improve pg_sync_replication_slots() to wait for primary to advance