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 1vk3Jq-008qG4-1F for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Jan 2026 16:50:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vk3Jp-005ADL-1H for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Jan 2026 16:50:33 +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 1vk3Jo-005ADC-0r for pgsql-hackers@lists.postgresql.org; Sun, 25 Jan 2026 16:50:33 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vk3Jl-002Fon-2Y for pgsql-hackers@lists.postgresql.org; Sun, 25 Jan 2026 16:50:31 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4A2C01400042; Sun, 25 Jan 2026 11:50:29 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sun, 25 Jan 2026 11:50:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc: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=fm2; t=1769359829; x=1769446229; bh=+zXDeVeeKB MRKDjxqbqKzaOxs+2qF4LlIafsYgQj/N4=; b=JBUgdc67YCvYay+ziSenlaBz6a 2DQikW+vbZgv/VndRx1X04HJEXXxOaXMxMfFnoyF8bizKEZYtTfTHcSREqCtzgjT fO7cvmthKZKxYC0MHFpx2cLR5SU7kMtjpzFLZhpkd3b+uGistqkES6tPBZ3jxz/s ompJRVDoXm2QIwaRp+WjnpFy/Qwr2ucA2UJDhWUw8DWy/CRdWR92wB3S8dwSOARC p3sHWgYeV9/mLgGkZ5aMIzu62UBdqXTmDNTbI+I1gg4DJOuZRN4bBJCVcmrHMIS0 DKsIYoXXf5A1u9EZdSt42xKfSqc0LqtCGZT1gkHAgOmDeou/WuEhzQwPgeLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= 1769359829; x=1769446229; bh=+zXDeVeeKBMRKDjxqbqKzaOxs+2qF4LlIaf sYgQj/N4=; b=I/dfb86m7dykzJAQuViXCNvt1NWca+XpsJ57rRZxqcIYPCe6XY9 vGvsMt1kw11+KPOPHgxIBWQLty822xdLePvT4QUFjfy6VWN4tjHB1GvB5VPac6mF fsR8NXzY2rWbk/WVt7zkR7RzPid2ogeKT+xnhjbop2Sdlog1qK9T8ZfDTdlUxa7M eLgxurTMX8Xsq8oTreRxs7Mi0xUriGqxBo8tORp2D5RVrtW2dP20lK9DwU9X0o/c 0MObBWHpEZV0zIe/WFZ4LoUdmAVq2LpaORRIewZZ2LlpLBqm/SUOashlzvAQ5yuZ LQnfZL+8eWqMqiU/ys5JW6oa2G2uEuxt+xg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduheehfeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtsfdttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepfeffgfelvdffgedtveelgfdtgefghfdvkefggeetieevjeekteduleevjefh ueegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopeegpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgh dprhgtphhtthhopehthhhomhgrshdrmhhunhhrohesghhmrghilhdrtghomhdprhgtphht thhopehpohhsthhgrhgvshesjhgvlhhtvghfrdhnlhdprhgtphhtthhopehpghhsqhhlqd hhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 25 Jan 2026 11:50:28 -0500 (EST) Date: Sun, 25 Jan 2026 11:50:28 -0500 From: Andres Freund To: Jelte Fennema-Nio Cc: Peter Eisentraut , PostgreSQL Hackers , Thomas Munro Subject: Re: Make copyObject work in C++ Message-ID: References: <4d8b9e53-3f37-43f0-a4aa-5bda9c7961b3@eisentraut.org> <4e82f77b-acad-4356-94f6-8255135fb36b@eisentraut.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-01-25 13:42:51 +0100, Jelte Fennema-Nio wrote: > This reverts to using positional initializers in PG_MODULE_MAGIC_DATA so > that its possible to write C++ extensions in standard C++11. Sadly that > means that using designated initializers in C++20 is still not allowed > in PG_MODULE_MAGIC_EXT because mixing designated an positional > initializers is a C only feature. This restriction for C++ extensions is > now documented and tested. I'm pretty sceptical this is the right direction. We were going for designated initializers for a reason, namely that we expect more arguments to be added over time and perhaps eventually also to remove some. And this will just lead to that being harder because we have to worry about C++ extensions. But I'm also confused as to why it's needed - there's nomixing of designated and non-designated initializers that I can see? If you use PG_MODULE_MAGIC_EXT(.name = "whatnot"), it evaluates down to extern __attribute__((visibility("default"))) const Pg_magic_struct *Pg_magic_func(void); const Pg_magic_struct * Pg_magic_func(void) { static const Pg_magic_struct Pg_magic_data = { .len = sizeof(Pg_magic_struct), .abi_fields = { 190000 / 100, 100, 32, 64, true, "PostgreSQL", }, .name="whatnot"}; return &Pg_magic_data; } extern int no_such_variable; And indeed, contra to what you reported upthread, I can't get clang to report a warning about that. I do obviously see warnings about the wrong order if I pass the arguments in the wrong order, but that's a lot less problematic. And omitted args don't trigger warnings, as you noted. Greetings, Andres Freund