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 1w7pA7-005jIm-0f for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 06:34:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7pA5-00FGME-24 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 06:34:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w7pA5-00FGLz-18 for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 06:34:45 +0000 Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w7pA2-00000002J7N-3P9q for pgsql-hackers@postgresql.org; Wed, 01 Apr 2026 06:34:45 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id 4228B1D00320 for ; Wed, 1 Apr 2026 02:34:41 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Wed, 01 Apr 2026 02:34:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=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=1775025280; x=1775111680; bh=gyUiAx/P4peVU7DK4LrHlfGUqvjpGDuyll05Pi4YZLU=; b= DSUtbxxiv/e1Omyz/av0r62ewtyK9FJF7+0Nb58l3XV/vHi196pkdNcQT1xcgj/I tO55Vi8OtXzXJfDth8XcsAZtK2h7cFsFuhl6vXkn8SmcjFWrRrvK2Tnw5TPDaACq gv2DKS8GzUijy288YqHL/keLzjzdCSQpZF6LMbhPQuiycPtuqQVmPF8kswnP0U11 Ka+t4/HCVUkMIOZ60lAA7FONXd2PQ4EtOfhkWRsiFDqalgNT0a9rkts62JSVs8zB JLvpgxX2vIQJEtBNwGVCPByveM5nPO6Yh6fnvLWogByBEDYLqxiUoAGmjaFmALkI ftzrzMTqs1aid0r9Vn2THQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=1775025280; x=1775111680; bh=g yUiAx/P4peVU7DK4LrHlfGUqvjpGDuyll05Pi4YZLU=; b=LWeVlwt6NnxsWTzTN 5jeDslA/rYB/s8oHTNSvoLFBj/QOtivII5Ify0L07R2jMgo0h0rUL3YltlKQhtVW s7CmVoevlZGLoopKtWFhYicyUwx/bRyFwTPsuCG2doJdYQFXfdz0qhaMQeeK7Ehq Kg42RQ8gwv6WqpfN2JHXeVLWoZKjfxBEjNj+7ZdwKrTqd0otTW2xKsdor7fkyLz9 r1H5KCQHJ1bXPU3N2Xx6XSB+mw+LHRdJcQEs13yV5Ohxo0aRLQgzEx4zu1jyUG2O iNNr6TQf9pWoBubLZAudfEaKh5DsOnTt/ATLDGHZe/3MsFZI6TRH1jLw9PqVYMCi bNG8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvgedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucenucfjughrpefkffggfgfuhffvfhgjtgfgsehtkeertddtvd ejnecuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhs vghnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepuddtiefghfeitdejudffie ekfeejvdduieelffevueejudevueelleevteduieeknecuffhomhgrihhnpehpohhsthhg rhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhrghdpnhgspghrtghpthht ohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvg hrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 1 Apr 2026 02:34:40 -0400 (EDT) Message-ID: <5fef914b-1dab-40f4-ad08-c336be412c92@eisentraut.org> Date: Wed, 1 Apr 2026 08:34:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Use standard C23 and C++ attributes if available From: Peter Eisentraut To: pgsql-hackers References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 19.02.26 09:54, Peter Eisentraut wrote: > This is related to the C++ compatibility work in [0]. > > This patch proposes to use the standard C23 and C++ attributes > [[nodiscard]], [[noreturn]], and [[maybe_unused]], if available. > > The immediate practical impact is that for pg_noreturn, we can drop the > GCC-specific and MSVC-specific fallbacks, because the C11 and the C++ > implementation will now cover all required cases. > > For the other two attributes, this makes them available in not-GCC- > compatible compilers that support C23 as well as in C++.  This set is > theoretical at the moment, but it might become more practical if either > MSVC gets some C23 support or we improve the support for C++ extensions > with MSVC (see also [0]). > > > [0]: https://www.postgresql.org/message-id/df78eaac- > c2eb-4344-852e-0965c75c5ad6%40eisentraut.org This has been committed. Note that the C++ extension support with MSVC exists now, so this patch has some utility for that.