Portable StaticAssertExpr
Peter Eisentraut <peter@eisentraut.org>
Author:
Peter Eisentraut <peter@eisentraut.org>
Date: 2026-03-06T08:27:54Z
Releases:
19 (unreleased)
Portable StaticAssertExpr Use a different way to write StaticAssertExpr() that does not require the GCC extension statement expressions. For C, we put the static_assert into a struct. This appears to be a common approach. We still need to keep the fallback implementation to support buggy MSVC < 19.33. For C++, we put it into a lambda expression. (The C approach doesn't work; it's not permitted to define a new type inside sizeof.) Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl> Discussion: https://www.postgresql.org/message-id/flat/5fa3a9f5-eb9a-4408-9baf-403d281f8b10%40eisentraut.org
Files
| Path | Change | +/− |
|---|---|---|
| config/c-compiler.m4 | modified | +0 −16 |
| configure | modified | +0 −31 |
| configure.ac | modified | +0 −1 |
| meson.build | modified | +0 −13 |
| src/include/c.h | modified | +22 −8 |
| src/include/pg_config.h.in | modified | +0 −3 |
Discussion
- Portable StaticAssertExpr 3 messages · 2026-02-23 → 2026-03-06