public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nathan Bossart <[email protected]>
To: Jelte Fennema-Nio <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Make foreach_ptr macro work in C++ extensions
Date: Mon, 14 Oct 2024 15:29:34 -0500
Message-ID: <Zw1_Lqa7cB4wbYtY@nathan> (raw)
In-Reply-To: <CAGECzQSYG3QfHrc-rOk2KbnB9iJOd7Qu-Xii1s-GTA=3JFt49Q@mail.gmail.com>
References: <CAGECzQSYG3QfHrc-rOk2KbnB9iJOd7Qu-Xii1s-GTA=3JFt49Q@mail.gmail.com>

On Mon, Oct 14, 2024 at 10:05:42PM +0200, Jelte Fennema-Nio wrote:
> I've been writing a C++ extension recently and it turns out that the
> foreach_ptr macro added in PG17 by one of my patches causes a
> compilation failure when used in C++. This is due to C++ its stricter
> rules around implicit casts from void pointers.

Whoops.

> Attached is a tiny patch that fixes that by adding an explicit cast to
> the macro.

Looks reasonable to me.

> I think it would be good to backpatch this to PG17 as well,
> as to not introduce some differences in the macro across versions.

I'd consider this a "low-risk" fix, which our versioning page [0] says is
acceptable for a minor release, so I'll plan on back-patching unless
someone objects.

[0] https://www.postgresql.org/support/versioning/

-- 
nathan






view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Make foreach_ptr macro work in C++ extensions
  In-Reply-To: <Zw1_Lqa7cB4wbYtY@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox