Re: Cannot find a working 64-bit integer type on Illumos
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Thomas Munro <thomas.munro@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Japin Li <japinli@hotmail.com>, Andres Freund <andres@anarazel.de>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-04-19T08:34:38Z
Lists: pgsql-hackers
On 18.04.24 02:31, Thomas Munro wrote:
> For limits, why do we have this:
>
> - * stdint.h limits aren't guaranteed to have compatible types with our fixed
> - * width types. So just define our own.
>
> ? I mean, how could they not have compatible types?
The commit for this was 62e2a8dc2c7 and the thread was
<https://www.postgresql.org/message-id/flat/E1YatAv-0007cu-KW%40gemulon.postgresql.org>.
The problem was that something like
snprintf(bufm, sizeof(bufm), INT64_FORMAT, SEQ_MINVALUE);
could issue a warning if, say, INT64_FORMAT, which refers to our own
int64, is based on long int, but SEQ_MINVALUE, which was then INT64_MIN,
which refers to int64_t, which could be long long int.
So this is correct. If we introduce the use of int64_t, then you need
to be consistent still:
int64, PG_INT64_MIN, PG_INT64_MAX, INT64_FORMAT
int64_t, INT64_MIN, INT64_MAX, PRId64
Commits
-
Move pg_int64 back to postgres_ext.h
- e56a601e0678 19 (unreleased) landed
- 409543da5411 18.0 landed
-
pgbench: Make set_random_seed() 64-bit everywhere.
- 53a2a1564ae4 18.0 landed
-
Use PRI?64 instead of "ll?" in format strings (continued).
- a0ed19e0a9ef 18.0 landed
-
Fix order of -I switches for building pg_regress.o.
- f186f90e55b7 17.5 landed
- cb36f8ec2124 18.0 landed
-
libpq: Deprecate pg_int64.
- 3c86223c9982 18.0 landed
-
Use PRI*64 instead of "ll*" in format strings (minimal trial)
- 15a79c73111f 18.0 landed
-
Fix header inclusion order in c.h.
- 71cb352904c1 18.0 landed
-
Use <stdint.h> and <inttypes.h> for c.h integers.
- 962da900ac8f 18.0 landed
-
Remove traces of BeOS.
- a2d9a9b95ad9 18.0 landed
-
More correct way to check for existence of types, which allows to specify
- 15abc7788e66 7.2.1 cited