Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1viH4W-0027BN-0l for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jan 2026 19:07:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1viH4V-002eM9-1B for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jan 2026 19:07:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1viH4U-002eLs-1u for pgsql-hackers@lists.postgresql.org; Tue, 20 Jan 2026 19:07:23 +0000 Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1viH4S-001T0g-0u for pgsql-hackers@lists.postgresql.org; Tue, 20 Jan 2026 19:07:22 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id ADF80EC020B; Tue, 20 Jan 2026 14:07:19 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Tue, 20 Jan 2026 14:07:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1768936039; x=1769022439; bh=qFef7wCCwhCGjDlp0Ciy+QJy7CZ6lmrh QxGotLp0sj8=; b=iA1n/RpBneM8CLG+sVop8Jss1yMIm2ro/Z9zpbupxqpZc0Ia Z8cysvHG3PqZiCzYMtgjPogGGn29wU5ASCqfQuie7lq0yQsrp6muLeNTs1tLNL9X i3OgIgY/frZo83DYHcYxryVYDmXx3zGCXzsieyh1bjphTLqFQydpEYt8rotpU9Fx wRNVZx3lC8lnOCH5jWUo0rsdLxP02A4XIQF7Y/rpRxhHEnaP+TFXgYdSbbB84Wh5 TSjYOZeeLhkwfYPcvKus08WakDMBNAsDKR9BrNqF0Bzv41D90vJZ0LODWlmtpeaj r64H8vB5SE7vD4JMgtR6C5mxkWbgHw4WH/aCGQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1768936039; x= 1769022439; bh=qFef7wCCwhCGjDlp0Ciy+QJy7CZ6lmrhQxGotLp0sj8=; b=W U/fZGf+eVf0vOV7aws6/SHQXDp1TOgBo9uYScX+xz2WXMrUX8s8051a6eWYdRY2D evroEMb1f8Ach+Mkry22yTqU7i+TdtsjQFQPDrfloOTYuNwLAQbH/5WlYcBxJ1i/ iIPvqbCq5ft1CRT2IIrUHk5ViLKEvb6f8ajAudSfN7jJKzhMOm9eR8gMwY/eQtfD WGwKqKumzYcatQx/zJ3/wCpCrU88XiZFgarz2Wjy/yb6f4tnPlXHx0B8RezS548V RrkpplbY+QPuB4coTGZeHfZZtJK7bCyfhqTDZlNfmI54iQvMyBciaUSEKeJGoheT qgm0KgHk4yw1vxiYjBJtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugeduvdduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgheqne cuggftrfgrthhtvghrnhepfeegteefvdevgfdvhfejgfelteffheejkedukeetffekkeef gfdufeetkedtuefgnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghdpphhgsh hqlhdrsghuihhlugenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhrghdpnhgspghrtghpthhtoh epgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghnughrvghssegrnhgrrhgr iigvlhdruggvpdhrtghpthhtohepphhoshhtghhrvghssehjvghlthgvfhdrnhhlpdhrtg hpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhl rdhorhhgpdhrtghpthhtohepthhhohhmrghsrdhmuhhnrhhosehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Jan 2026 14:07:18 -0500 (EST) Message-ID: Date: Tue, 20 Jan 2026 20:07:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Make copyObject work in C++ To: Andres Freund Cc: Jelte Fennema-Nio , PostgreSQL Hackers , Thomas Munro References: <4d8b9e53-3f37-43f0-a4aa-5bda9c7961b3@eisentraut.org> <4e82f77b-acad-4356-94f6-8255135fb36b@eisentraut.org> Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 20.01.26 17:38, Andres Freund 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. > Seems like billbug doesn't like this: > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl? > nm=billbug&dt=2026-01-20%2016%3A00%3A02 > > gmake[1]: Entering directory '/home/marcel/build-farm-20/buildroot/HEAD/pgsql.build/src/test/modules/test_cplusplusext' > g++ -Wall -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -I. -I. -I../../../../src/include -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS -I/usr/openssl/3/include -I/usr/include/libxml2 -c -o test_cplusplusext.o test_cplusplusext.cpp > In file included from ../../../../src/include/postgres.h:48, > from test_cplusplusext.cpp:18: > ../../../../src/include/c.h:158:21: error: '_Noreturn' does not name a type; did you mean 'pg_noreturn'? > 158 | #define pg_noreturn _Noreturn > | ^~~~~~~~~ > ../../../../src/include/c.h:918:1: note: in expansion of macro 'pg_noreturn' > 918 | pg_noreturn extern void ExceptionalCondition(const char *conditionName, > | ^~~~~~~~~~~ It's getting confused by _Noreturn, which is defined thus: #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #define pg_noreturn _Noreturn But apparently on these Solaris-related platforms, g++ defines __STDC_VERSION__ even in C++ mode. (Confirmed in local testing.) Apparently, this is even allowed by the C++ standard. So the smallest fix is probably to gate this more like this: #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__cplusplus) #define pg_noreturn _Noreturn (Eventually, we could add support for C++ attributes, but one step at a time.)