postgresql/src
Tom Lane 92cf557ffa Add static assertion that RELSEG_SIZE fits in an int.
Our configure script intended to ensure this, but it supposed that
expr(1) would report an error for integer overflow.  Maybe that
was true when the code was written (commit 3c6248a82 of 2008-05-02),
but all the modern expr's I tried will deliver bigger-than-int32
results without complaint.  Moreover, if you use --with-segsize-blocks
then there's no check at all.

Ideally we'd add a test in configure itself to check that the value
fits in int, but to do that we'd need to suppose that test(1) handles
bigger-than-int32 numbers correctly.  Probably modern ones do, but
that's an assumption I could do without; and I'm not too trusting
about meson either.  Instead, let's install a static assertion, so
that even people who ignore all the compiler warnings you get from
such values will be forced to confront the fact that it won't work.

This has been hazardous for awhile, but given that we hadn't heard
a complaint about it till now, I don't feel a need to back-patch.

Reported-by: Casey Shobe <casey.allen.shobe@icloud.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/C5DC82D6-C76D-4E8F-BC2E-DF03EFC4FA24@icloud.com
2025-10-19 18:28:46 -04:00
..
backend Add static assertion that RELSEG_SIZE fits in an int. 2025-10-19 18:28:46 -04:00
bin Don't rely on zlib's gzgetc() macro. 2025-10-19 14:36:58 -04:00
common Fix compiler warnings around _CRT_glob 2025-10-01 17:13:52 +02:00
fe_utils Introduce frontend API able to retrieve the contents of PG_VERSION 2025-10-14 16:20:42 +09:00
include Add pg_database_locale() to retrieve database default locale. 2025-10-18 16:25:23 -07:00
interfaces ecpg: check return value of replace_variables() 2025-10-17 10:03:15 +02:00
makefiles Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
pl plpython: Remove support for major version conflict detection 2025-10-15 08:18:29 +02:00
port Fix incorrect message-printing in win32security.c. 2025-10-13 17:56:45 -04:00
template Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
test Fix determination of not-null constraint "locality" for inherited columns 2025-10-18 18:18:19 +02:00
timezone Generate GUC tables from .dat file 2025-09-03 09:45:17 +02:00
tools Align the data block sizes of pg_dump's various compression modes. 2025-10-16 12:50:18 -04:00
tutorial Fix compile of src/tutorial/funcs.c 2025-10-07 10:45:57 +02:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
Makefile.shlib Use exported symbols list on macOS for loadable modules as well 2025-06-10 07:04:43 +02:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00