On Tue, Jan 20, 2026 at 10:43 AM Peter Eisentraut <[email protected]> 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


Reply via email to