| From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
|---|---|
| To: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Jelte Fennema <postgres(at)jeltef(dot)nl> |
| Subject: | Re: pgsql: tests: Add a test C++ extension module |
| Date: | 2026-01-21 20:25:00 |
| Message-ID: | CA+TgmoZ-kHBaf94Z6teCHnCLES20K8X-WrJqaGhKCgEDq-mQYA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers pgsql-hackers |
On Tue, Jan 20, 2026 at 10:43 AM Peter Eisentraut <peter(at)eisentraut(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jelte Fennema-Nio | 2026-01-21 21:00:39 | Re: pgsql: tests: Add a test C++ extension module |
| Previous Message | Nathan Bossart | 2026-01-21 20:21:28 | pgsql: Move x86-64-specific popcount code to pg_popcount_x86.c. |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 2026-01-21 20:25:16 | Re: Can we remove support for standard_conforming_strings = off yet? |
| Previous Message | Nathan Bossart | 2026-01-21 20:23:51 | Re: refactor architecture-specific popcount code |