pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Raise C requirement to C11
Date: Tue, 26 Aug 2025 09:56:34 +0000
Message-ID: <E1uqqPp-001jw5-1f@gemulon.postgresql.org> (raw)

Raise C requirement to C11

This changes configure and meson.build to require at least C11,
instead of the previous C99.  The installation documentation is
updated accordingly.

configure.ac previously used AC_PROG_CC_C99 to activate C99.  But
there is no AC_PROG_CC_C11 in Autoconf 2.69, because it's too
old.  (Also, post-2.69, the AC_PROG_CC_Cnn macros were deprecated and
AC_PROG_CC activates the last supported C mode.)  We could update the
required Autoconf version, but that might be a separate project that
no one wants to undertake at the moment.  Instead, we open-code the
test for C11 using some inspiration from later Autoconf versions.  But
instead of writing an elaborate test program, we keep it simple and
just check __STDC_VERSION__, which should be good enough in practice.

In meson.build, we update the existing C99 test to C11, but again we
just check for __STDC_VERSION__.

This also removes the separate option for the conforming preprocessor
on MSVC, added by commit 8fd9bb1d965, since that is activated
automatically in C11 mode.

Note, we don't use the "official" way to set the C standard in Meson
using the c_std project option, because that is impossible to use
correctly (see <https://github.com/mesonbuild/meson/issues/14717;).

Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/01a69441-af54-4822-891b-ca28e05b215a@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f5e0186f865cc188ef6f4b2bc77d0c028f78195e

Modified Files
--------------
configure                      | 204 +++++++----------------------------------
configure.ac                   |  29 +++++-
doc/src/sgml/installation.sgml |   7 +-
doc/src/sgml/sources.sgml      |  12 +--
meson.build                    |  59 ++++--------
5 files changed, 83 insertions(+), 228 deletions(-)



Message-ID: <E1uqqPp-001jw5-1f@gemulon.postgresql.org>
Permalink:  ../E1uqqPp-001jw5-1f@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uqqPp-001jw5-1f@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: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Raise C requirement to C11
  In-Reply-To: <E1uqqPp-001jw5-1f@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