pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Jelte Fennema <postgres@jeltef.nl>
Subject: Re: pgsql: tests: Add a test C++ extension module
Date: Wed, 21 Jan 2026 15:25:00 -0500
Message-ID: <CA+TgmoZ-kHBaf94Z6teCHnCLES20K8X-WrJqaGhKCgEDq-mQYA@mail.gmail.com> (raw)
In-Reply-To: <E1viDt1-001d7E-2I@gemulon.postgresql.org>
References: <E1viDt1-001d7E-2I@gemulon.postgresql.org>

On Tue, Jan 20, 2026 at 10:43 AM Peter Eisentraut <peter@eisentraut.org> wrote:
> tests: Add a test C++ extension module

This patch caused my usual build process to fail. I have been setting
CC='ccache clang' in my environment, and I was able to fix make it
work again by also setting CXX='ccache clang'. Before that, I was
getting my macPorts version of clang (21.1.2) for C source files but
the OS version of clang (15.0.0) for c++ files. But I still don't
really understand how that caused this failure, which doesn't look
like it has anything to do with mixing compilers:

[1/3] Compiling C++ object src/test/mo...plusext.dylib.p/test_cplusplusext.cpp.
FAILED: [code=1]
src/test/modules/test_cplusplusext/test_cplusplusext.dylib.p/test_cplusplusext.cpp.o
ccache c++ -Isrc/test/modules/test_cplusplusext/test_cplusplusext.dylib.p
-Isrc/include -I../pgsql/src/include -I/opt/local/include
-I/opt/local/include/libxml2 -I/opt/local/libexec/openssl3/include
-fdiagnostics-color=always -D_LIBCPP_ENABLE_ASSERTIONS=1 -Wall
-Winvalid-pch -O2 -g -fno-strict-aliasing -fwrapv -Wmissing-prototypes
-Wpointer-arith -Werror=vla -Werror=unguarded-availability-new
-Wendif-labels -Wmissing-format-attribute -Wcast-function-type
-Wformat-security -Wno-unused-command-line-argument
-Wno-compound-token-split-by-macro -fvisibility=hidden
-fvisibility=hidden -fvisibility-inlines-hidden -MD -MQ
src/test/modules/test_cplusplusext/test_cplusplusext.dylib.p/test_cplusplusext.cpp.o
-MF src/test/modules/test_cplusplusext/test_cplusplusext.dylib.p/test_cplusplusext.cpp.o.d
-o src/test/modules/test_cplusplusext/test_cplusplusext.dylib.p/test_cplusplusext.cpp.o
-c ../pgsql/src/test/modules/test_cplusplusext/test_cplusplusext.cpp
In file included from
../pgsql/src/test/modules/test_cplusplusext/test_cplusplusext.cpp:18:
In file included from ../pgsql/src/include/postgres.h:48:
../pgsql/src/include/c.h:1113:10: error: expected parameter declarator
        alignas(MAXIMUM_ALIGNOF) char data[BLCKSZ];
                ^
src/include/pg_config.h:342:25: note: expanded from macro 'MAXIMUM_ALIGNOF'
#define MAXIMUM_ALIGNOF 8
                        ^
In file included from
../pgsql/src/test/modules/test_cplusplusext/test_cplusplusext.cpp:18:
In file included from ../pgsql/src/include/postgres.h:48:
../pgsql/src/include/c.h:1113:10: error: expected ')'
src/include/pg_config.h:342:25: note: expanded from macro 'MAXIMUM_ALIGNOF'
#define MAXIMUM_ALIGNOF 8
                        ^
../pgsql/src/include/c.h:1113:9: note: to match this '('
        alignas(MAXIMUM_ALIGNOF) char data[BLCKSZ];
               ^
../pgsql/src/include/c.h:1113:2: error: a type specifier is required
for all declarations
        alignas(MAXIMUM_ALIGNOF) char data[BLCKSZ];
        ^
../pgsql/src/include/c.h:1113:26: error: expected ';' at end of declaration list
        alignas(MAXIMUM_ALIGNOF) char data[BLCKSZ];
                                ^
                                ;
../pgsql/src/include/c.h:1126:10: error: expected parameter declarator
        alignas(PG_IO_ALIGN_SIZE) char data[BLCKSZ];
                ^
../pgsql/src/include/pg_config_manual.h:223:27: note: expanded from
macro 'PG_IO_ALIGN_SIZE'
#define PG_IO_ALIGN_SIZE                4096
                                        ^
In file included from
../pgsql/src/test/modules/test_cplusplusext/test_cplusplusext.cpp:18:
In file included from ../pgsql/src/include/postgres.h:48:
../pgsql/src/include/c.h:1126:10: error: expected ')'
../pgsql/src/include/pg_config_manual.h:223:27: note: expanded from
macro 'PG_IO_ALIGN_SIZE'
#define PG_IO_ALIGN_SIZE                4096
                                        ^
../pgsql/src/include/c.h:1126:9: note: to match this '('
        alignas(PG_IO_ALIGN_SIZE) char data[BLCKSZ];
               ^
../pgsql/src/include/c.h:1126:2: error: a type specifier is required
for all declarations
        alignas(PG_IO_ALIGN_SIZE) char data[BLCKSZ];
        ^
../pgsql/src/include/c.h:1126:27: error: expected ';' at end of declaration list
        alignas(PG_IO_ALIGN_SIZE) char data[BLCKSZ];
                                 ^
                                 ;
../pgsql/src/include/c.h:1132:10: error: expected parameter declarator
        alignas(PG_IO_ALIGN_SIZE) char data[XLOG_BLCKSZ];
                ^
../pgsql/src/include/pg_config_manual.h:223:27: note: expanded from
macro 'PG_IO_ALIGN_SIZE'
#define PG_IO_ALIGN_SIZE                4096
                                        ^
In file included from
../pgsql/src/test/modules/test_cplusplusext/test_cplusplusext.cpp:18:
In file included from ../pgsql/src/include/postgres.h:48:
../pgsql/src/include/c.h:1132:10: error: expected ')'
../pgsql/src/include/pg_config_manual.h:223:27: note: expanded from
macro 'PG_IO_ALIGN_SIZE'
#define PG_IO_ALIGN_SIZE                4096
                                        ^
../pgsql/src/include/c.h:1132:9: note: to match this '('
        alignas(PG_IO_ALIGN_SIZE) char data[XLOG_BLCKSZ];
               ^
../pgsql/src/include/c.h:1132:2: error: a type specifier is required
for all declarations
        alignas(PG_IO_ALIGN_SIZE) char data[XLOG_BLCKSZ];
        ^
../pgsql/src/include/c.h:1132:27: error: expected ';' at end of declaration list
        alignas(PG_IO_ALIGN_SIZE) char data[XLOG_BLCKSZ];
                                 ^
                                 ;
12 errors generated.
ninja: build stopped: subcommand failed.

-- 
Robert Haas
EDB: http://www.enterprisedb.com





view thread (10+ messages)  latest in thread

Message-ID: <CA+TgmoZ-kHBaf94Z6teCHnCLES20K8X-WrJqaGhKCgEDq-mQYA@mail.gmail.com>
Permalink:  ../CA+TgmoZ-kHBaf94Z6teCHnCLES20K8X-WrJqaGhKCgEDq-mQYA@mail.gmail.com/
Also on:    postgresql.org/message-id/CA+TgmoZ-kHBaf94Z6teCHnCLES20K8X-WrJqaGhKCgEDq-mQYA@mail.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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: robertmhaas@gmail.com, peter@eisentraut.org, pgsql-hackers@lists.postgresql.org, postgres@jeltef.nl
  Subject: Re: pgsql: tests: Add a test C++ extension module
  In-Reply-To: <CA+TgmoZ-kHBaf94Z6teCHnCLES20K8X-WrJqaGhKCgEDq-mQYA@mail.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