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 1vjL2K-00DH2r-1a for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jan 2026 17:33:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vjL2J-000rPr-1H for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jan 2026 17:33:31 +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 1vjL2J-000rPf-0H for pgsql-hackers@lists.postgresql.org; Fri, 23 Jan 2026 17:33:31 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vjL2G-001wbV-2J for pgsql-hackers@postgresql.org; Fri, 23 Jan 2026 17:33:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 60NHXQSs3119481; Fri, 23 Jan 2026 12:33:26 -0500 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers Subject: Re: alignas (C11) In-reply-to: <0032fbcb-8fb0-4e65-8928-f2c4e9b62ba6@eisentraut.org> References: <46f05236-d4d4-4b4e-84d4-faa500f14691@eisentraut.org> <0032fbcb-8fb0-4e65-8928-f2c4e9b62ba6@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Mon, 01 Dec 2025 08:03:49 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3119479.1769189606.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Jan 2026 12:33:26 -0500 Message-ID: <3119480.1769189606@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > This patch set has been committed, it looks like without buildfarm = > complaints. Things were fine until test_cplusplusext was added, but now some older compilers seem to reject this in C++ mode. For example at [1]: make[1]: Entering directory '/home/debian/20-chimaera/buildroot/HEAD/pgsql= .build/src/test/modules/test_cplusplusext' g++ -Wall -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wform= at-security -fno-strict-aliasing -fwrapv -fexcess-precision=3Dstandard -g = -O2 -fPIC -fvisibility=3Dhidden -fvisibility-inlines-hidden -I. -I/home/de= bian/20-chimaera/buildroot/HEAD/pgsql.build/../pgsql/src/test/modules/test= _cplusplusext -I../../../../src/include -I/home/debian/20-chimaera/buildro= ot/HEAD/pgsql.build/../pgsql/src/include -D_GNU_SOURCE -I/usr/include/lib= xml2 -c -o test_cplusplusext.o /home/debian/20-chimaera/buildroot/HEAD= /pgsql.build/../pgsql/src/test/modules/test_cplusplusext/test_cplusplusext= .cpp In file included from /home/debian/20-chimaera/buildroot/HEAD/pgsql.build/= ../pgsql/src/include/postgres.h:48:0, from /home/debian/20-chimaera/buildroot/HEAD/pgsql.build/= ../pgsql/src/test/modules/test_cplusplusext/test_cplusplusext.cpp:18: /home/debian/20-chimaera/buildroot/HEAD/pgsql.build/../pgsql/src/include/c= .h:1126:44: warning: requested alignment 4096 is larger than 128 [-Wattrib= utes] alignas(PG_IO_ALIGN_SIZE) char data[BLCKSZ]; ^ /home/debian/20-chimaera/buildroot/HEAD/pgsql.build/../pgsql/src/include/c= .h:1132:49: warning: requested alignment 4096 is larger than 128 [-Wattrib= utes] alignas(PG_IO_ALIGN_SIZE) char data[XLOG_BLCKSZ]; ^ Not sure what to do about that, but I do read it as indicating that we cannot put any faith in the compiler to honor such large alignment demands. A possible short-term(?) workaround is to wrap those two declarations in "#ifndef __cplusplus", so that C++ code can't declare such variables. regards, tom lane [1] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=3Dchimae= ra&dt=3D2026-01-23%2011%3A44%3A01&stg=3Dmake-testmodules