pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bryan Green <dbryan.green@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Subject: Re: Make copyObject work in C++
Date: Wed, 4 Feb 2026 09:54:37 -0600
Message-ID: <b03ddcd4-2a16-49ee-b105-e7f609f3c514@gmail.com> (raw)
In-Reply-To: <DFXOG2P1QMS8.3L7MCAL0E6MVJ@jeltef.nl>
References: <CAGECzQR21OnnKiZO_1rLWO0-16kg1JBxnVq-wymYW0-_1cUNtg@mail.gmail.com>
	<4d8b9e53-3f37-43f0-a4aa-5bda9c7961b3@eisentraut.org>
	<DFEUMBSUG8KA.XGY0CN9PFPR2@jeltef.nl>
	<DFKV26A4CHG2.CB7NJ1X62BKH@jeltef.nl>
	<fd1a4790-4fbc-43b4-a385-e3b98b9ed04d@eisentraut.org>
	<DFQYWIJD4L1J.3HQFOWSWKLFOR@jeltef.nl>
	<4e82f77b-acad-4356-94f6-8255135fb36b@eisentraut.org>
	<DFXOG2P1QMS8.3L7MCAL0E6MVJ@jeltef.nl>

On 1/25/2026 6:42 AM, Jelte Fennema-Nio wrote:
> On Tue Jan 20, 2026 at 5:28 PM CET, Peter Eisentraut wrote:
>> I have split your first patch further.  For a start, I left out the
>> PG_MODULE_MAGIC*-related changes and disabled the module under MSVC.
>> This has been committed.  I plan to let the buildfarm run with it for
>> a day or two and then add in the basic MSVC support.
> 
> To hopefully make your life a bit easier. Here's a rebased version that
> enables the MSVC support again, with an updated commit message.
> 
This causes the build to break on VS 2022.  Versions prior do not have
support for __typeof_unqual__.  This would have led to
HAVE_TYPEOF_UNQUAL being not defined on the buildfarm causing the
fallback to copyObjectImpl() for VS 2019.

When you build on VS 2022 you will get an error:
../src/backend/commands/event_trigger.c(1901): error C2100: you cannot
dereference an operand of type 'void'

VS 2022 (MSVC) does not handle the void * dereference the way gcc/clang
does (thanks to GNU extensions, I believe).  It exposes
__typeof_unqual__ even it C11, but enforces strict C semantics on the
void * dereference.  To work on this platform the call
copyObject(lfirst(cell)) would need to have a cast to the correct
concrete type: copyObject((Node *)lfirst(cell)).

I was about to update to VS 2026, but now I think I should have an
instance of VS from 2019, 2022, and 2026.

-- 
Bryan Green
EDB: https://www.enterprisedb.com





view thread (51+ messages)  latest in thread

Message-ID: <b03ddcd4-2a16-49ee-b105-e7f609f3c514@gmail.com>
Permalink:  ../b03ddcd4-2a16-49ee-b105-e7f609f3c514@gmail.com/
Also on:    postgresql.org/message-id/b03ddcd4-2a16-49ee-b105-e7f609f3c514@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: dbryan.green@gmail.com
  Subject: Re: Make copyObject work in C++
  In-Reply-To: <b03ddcd4-2a16-49ee-b105-e7f609f3c514@gmail.com>
  References: <CAGECzQR21OnnKiZO_1rLWO0-16kg1JBxnVq-wymYW0-_1cUNtg@mail.gmail.com> <4d8b9e53-3f37-43f0-a4aa-5bda9c7961b3@eisentraut.org> <DFEUMBSUG8KA.XGY0CN9PFPR2@jeltef.nl> <DFKV26A4CHG2.CB7NJ1X62BKH@jeltef.nl> <fd1a4790-4fbc-43b4-a385-e3b98b9ed04d@eisentraut.org> <DFQYWIJD4L1J.3HQFOWSWKLFOR@jeltef.nl> <4e82f77b-acad-4356-94f6-8255135fb36b@eisentraut.org> <DFXOG2P1QMS8.3L7MCAL0E6MVJ@jeltef.nl> <b03ddcd4-2a16-49ee-b105-e7f609f3c514@gmail.com>

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

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