pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use <stdint.h> and <inttypes.h> for c.h integers.
Date: Wed, 04 Dec 2024 02:21:25 +0000
Message-ID: <E1tIf12-000zux-Pw@gemulon.postgresql.org> (raw)

Use <stdint.h> and <inttypes.h> for c.h integers.

Redefine our exact width types with standard C99 types and macros,
including int64_t, INT64_MAX, INT64_C(), PRId64 etc.  We were already
using <stdint.h> types in a few places.

One complication is that Windows' <inttypes.h> uses format strings like
"%I64d", "%I32", "%I" for PRI*64, PRI*32, PTR*PTR, instead of mapping to
other standardized format strings like "%lld" etc as seen on other known
systems.  Teach our snprintf.c to understand them.

This removes a lot of configure clutter, and should also allow 64-bit
numbers and other standard types to be used in localized messages
without casting.

Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/ME3P282MB3166F9D1F71F787929C0C7E7B6312%40ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/962da900ac8f0927f1af2fd811ca67fa163c873a

Modified Files
--------------
config/c-compiler.m4                               |  78 +----
configure                                          | 354 ++++++---------------
configure.ac                                       |  52 +--
meson.build                                        |  41 +--
src/Makefile.global.in                             |   6 -
src/bin/pg_waldump/pg_waldump.c                    |  16 +-
src/bin/pgbench/pgbench.c                          |   4 +-
src/include/.gitignore                             |   2 -
src/include/Makefile                               |   8 +-
src/include/c.h                                    | 101 +++---
src/include/meson.build                            |  12 +-
src/include/pg_config.h.in                         |  25 +-
src/include/pg_config_ext.h.in                     |   7 -
src/include/pg_config_ext.h.meson                  |   7 -
src/include/port/pg_bitutils.h                     |  16 +-
src/include/postgres_ext.h                         |   4 +-
src/include/utils/dsa.h                            |   2 +-
src/interfaces/ecpg/ecpglib/typename.c             |   9 +-
src/interfaces/ecpg/include/ecpg_config.h.in       |   8 +-
src/interfaces/ecpg/include/meson.build            |   4 +-
src/interfaces/ecpg/include/pgtypes_interval.h     |  12 +-
src/interfaces/ecpg/include/sqltypes.h             |   8 +-
.../ecpg/test/expected/compat_informix-sqlda.c     |   8 +-
src/port/pg_bitutils.c                             |   6 +-
src/port/snprintf.c                                |  64 +++-
25 files changed, 272 insertions(+), 582 deletions(-)



Message-ID: <E1tIf12-000zux-Pw@gemulon.postgresql.org>
Permalink:  ../E1tIf12-000zux-Pw@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tIf12-000zux-Pw@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tmunro@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Use <stdint.h> and <inttypes.h> for c.h integers.
  In-Reply-To: <E1tIf12-000zux-Pw@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox