pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Assume that <stdbool.h> conforms to the C standard.
8+ messages / 1 participants
[nested] [flat]

* pgsql: Assume that <stdbool.h> conforms to the C standard.
@ 2024-11-25 07:58 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Munro @ 2024-11-25 07:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Assume that <stdbool.h> conforms to the C standard.

Previously we checked "for <stdbool.h> that conforms to C99" using
autoconf's AC_HEADER_STDBOOL macro.  We've required C99 since PostgreSQL
12, so the test was redundant, and under C23 it was broken: autoconf
2.69's implementation doesn't understand C23's new empty header (the
macros it's looking for went away, replaced by language keywords).
Later autoconf versions fixed that, but let's just remove the
anachronistic test.

HAVE_STDBOOL_H and HAVE__BOOL will no longer be defined, but they
weren't directly tested in core or likely extensions (except in 11, see
below).  PG_USE_STDBOOL (or USE_STDBOOL in 11 and 12) is still defined
when sizeof(bool) is 1, which should be true on all modern systems.
Otherwise we define our own bool type and values of size 1, which would
fail to compile under C23 as revealed by the broken test.  (We'll
probably clean that dead code up in master, but here we want a minimal
back-patchable change.)

This came to our attention when GCC 15 recently started using using C23
by default and failed to compile the replacement code, as reported by
Sam James and build farm animal alligator.

Back-patch to all supported releases, and then two older versions that
also know about <stdbool.h>, per the recently-out-of-support policy[1].
12 requires C99 so it's much like the supported releases, but 11 only
assumes C89 so it now uses AC_CHECK_HEADERS instead of the overly picky
AC_HEADER_STDBOOL.  (I could find no discussion of which historical
systems had <stdbool.h> but failed the conformance test; if they ever
existed, they surely aren't relevant to that policy's goals.)

[1] https://wiki.postgresql.org/wiki/Committing_checklist#Policies

Reported-by: Sam James <sam@gentoo.org>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org> (master version)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (approach)
Discussion: https://www.postgresql.org/message-id/flat/87o72eo9iu.fsf%40gentoo.org

Branch
------
master

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

Modified Files
--------------
configure                  | 182 +++++++++++----------------------------------
configure.ac               |  13 +---
meson.build                |   9 +--
src/include/c.h            |   2 +-
src/include/pg_config.h.in |   6 --
5 files changed, 51 insertions(+), 161 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Assume that <stdbool.h> conforms to the C standard.
@ 2024-11-25 07:58 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Munro @ 2024-11-25 07:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Assume that <stdbool.h> conforms to the C standard.

Previously we checked "for <stdbool.h> that conforms to C99" using
autoconf's AC_HEADER_STDBOOL macro.  We've required C99 since PostgreSQL
12, so the test was redundant, and under C23 it was broken: autoconf
2.69's implementation doesn't understand C23's new empty header (the
macros it's looking for went away, replaced by language keywords).
Later autoconf versions fixed that, but let's just remove the
anachronistic test.

HAVE_STDBOOL_H and HAVE__BOOL will no longer be defined, but they
weren't directly tested in core or likely extensions (except in 11, see
below).  PG_USE_STDBOOL (or USE_STDBOOL in 11 and 12) is still defined
when sizeof(bool) is 1, which should be true on all modern systems.
Otherwise we define our own bool type and values of size 1, which would
fail to compile under C23 as revealed by the broken test.  (We'll
probably clean that dead code up in master, but here we want a minimal
back-patchable change.)

This came to our attention when GCC 15 recently started using using C23
by default and failed to compile the replacement code, as reported by
Sam James and build farm animal alligator.

Back-patch to all supported releases, and then two older versions that
also know about <stdbool.h>, per the recently-out-of-support policy[1].
12 requires C99 so it's much like the supported releases, but 11 only
assumes C89 so it now uses AC_CHECK_HEADERS instead of the overly picky
AC_HEADER_STDBOOL.  (I could find no discussion of which historical
systems had <stdbool.h> but failed the conformance test; if they ever
existed, they surely aren't relevant to that policy's goals.)

[1] https://wiki.postgresql.org/wiki/Committing_checklist#Policies

Reported-by: Sam James <sam@gentoo.org>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org> (master version)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (approach)
Discussion: https://www.postgresql.org/message-id/flat/87o72eo9iu.fsf%40gentoo.org

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0813a5e69186cb6705ce5b390d4488d8b783c8f2

Modified Files
--------------
configure                  | 182 +++++++++++----------------------------------
configure.ac               |  13 +---
meson.build                |   9 +--
src/include/c.h            |   2 +-
src/include/pg_config.h.in |   6 --
5 files changed, 51 insertions(+), 161 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Assume that <stdbool.h> conforms to the C standard.
@ 2024-11-25 07:59 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Munro @ 2024-11-25 07:59 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Assume that <stdbool.h> conforms to the C standard.

Previously we checked "for <stdbool.h> that conforms to C99" using
autoconf's AC_HEADER_STDBOOL macro.  We've required C99 since PostgreSQL
12, so the test was redundant, and under C23 it was broken: autoconf
2.69's implementation doesn't understand C23's new empty header (the
macros it's looking for went away, replaced by language keywords).
Later autoconf versions fixed that, but let's just remove the
anachronistic test.

HAVE_STDBOOL_H and HAVE__BOOL will no longer be defined, but they
weren't directly tested in core or likely extensions (except in 11, see
below).  PG_USE_STDBOOL (or USE_STDBOOL in 11 and 12) is still defined
when sizeof(bool) is 1, which should be true on all modern systems.
Otherwise we define our own bool type and values of size 1, which would
fail to compile under C23 as revealed by the broken test.  (We'll
probably clean that dead code up in master, but here we want a minimal
back-patchable change.)

This came to our attention when GCC 15 recently started using using C23
by default and failed to compile the replacement code, as reported by
Sam James and build farm animal alligator.

Back-patch to all supported releases, and then two older versions that
also know about <stdbool.h>, per the recently-out-of-support policy[1].
12 requires C99 so it's much like the supported releases, but 11 only
assumes C89 so it now uses AC_CHECK_HEADERS instead of the overly picky
AC_HEADER_STDBOOL.  (I could find no discussion of which historical
systems had <stdbool.h> but failed the conformance test; if they ever
existed, they surely aren't relevant to that policy's goals.)

[1] https://wiki.postgresql.org/wiki/Committing_checklist#Policies

Reported-by: Sam James <sam@gentoo.org>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org> (master version)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (approach)
Discussion: https://www.postgresql.org/message-id/flat/87o72eo9iu.fsf%40gentoo.org

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0f6d902308a82db2edaa0bc33f6ed5e5a00e8752

Modified Files
--------------
configure                  | 182 +++++++++++----------------------------------
configure.ac               |  13 +---
meson.build                |   9 +--
src/include/c.h            |   2 +-
src/include/pg_config.h.in |   6 --
src/tools/msvc/Solution.pm |   2 -
6 files changed, 51 insertions(+), 163 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Assume that <stdbool.h> conforms to the C standard.
@ 2024-11-25 07:59 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Munro @ 2024-11-25 07:59 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Assume that <stdbool.h> conforms to the C standard.

Previously we checked "for <stdbool.h> that conforms to C99" using
autoconf's AC_HEADER_STDBOOL macro.  We've required C99 since PostgreSQL
12, so the test was redundant, and under C23 it was broken: autoconf
2.69's implementation doesn't understand C23's new empty header (the
macros it's looking for went away, replaced by language keywords).
Later autoconf versions fixed that, but let's just remove the
anachronistic test.

HAVE_STDBOOL_H and HAVE__BOOL will no longer be defined, but they
weren't directly tested in core or likely extensions (except in 11, see
below).  PG_USE_STDBOOL (or USE_STDBOOL in 11 and 12) is still defined
when sizeof(bool) is 1, which should be true on all modern systems.
Otherwise we define our own bool type and values of size 1, which would
fail to compile under C23 as revealed by the broken test.  (We'll
probably clean that dead code up in master, but here we want a minimal
back-patchable change.)

This came to our attention when GCC 15 recently started using using C23
by default and failed to compile the replacement code, as reported by
Sam James and build farm animal alligator.

Back-patch to all supported releases, and then two older versions that
also know about <stdbool.h>, per the recently-out-of-support policy[1].
12 requires C99 so it's much like the supported releases, but 11 only
assumes C89 so it now uses AC_CHECK_HEADERS instead of the overly picky
AC_HEADER_STDBOOL.  (I could find no discussion of which historical
systems had <stdbool.h> but failed the conformance test; if they ever
existed, they surely aren't relevant to that policy's goals.)

[1] https://wiki.postgresql.org/wiki/Committing_checklist#Policies

Reported-by: Sam James <sam@gentoo.org>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org> (master version)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (approach)
Discussion: https://www.postgresql.org/message-id/flat/87o72eo9iu.fsf%40gentoo.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/94817d9d94d06e5edae408a919de907d2df4cee8

Modified Files
--------------
configure                  | 182 +++++++++++----------------------------------
configure.ac               |  13 +---
src/include/c.h            |   2 +-
src/include/pg_config.h.in |   6 --
src/tools/msvc/Solution.pm |   2 -
5 files changed, 48 insertions(+), 157 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Assume that <stdbool.h> conforms to the C standard.
@ 2024-11-25 07:59 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Munro @ 2024-11-25 07:59 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Assume that <stdbool.h> conforms to the C standard.

Previously we checked "for <stdbool.h> that conforms to C99" using
autoconf's AC_HEADER_STDBOOL macro.  We've required C99 since PostgreSQL
12, so the test was redundant, and under C23 it was broken: autoconf
2.69's implementation doesn't understand C23's new empty header (the
macros it's looking for went away, replaced by language keywords).
Later autoconf versions fixed that, but let's just remove the
anachronistic test.

HAVE_STDBOOL_H and HAVE__BOOL will no longer be defined, but they
weren't directly tested in core or likely extensions (except in 11, see
below).  PG_USE_STDBOOL (or USE_STDBOOL in 11 and 12) is still defined
when sizeof(bool) is 1, which should be true on all modern systems.
Otherwise we define our own bool type and values of size 1, which would
fail to compile under C23 as revealed by the broken test.  (We'll
probably clean that dead code up in master, but here we want a minimal
back-patchable change.)

This came to our attention when GCC 15 recently started using using C23
by default and failed to compile the replacement code, as reported by
Sam James and build farm animal alligator.

Back-patch to all supported releases, and then two older versions that
also know about <stdbool.h>, per the recently-out-of-support policy[1].
12 requires C99 so it's much like the supported releases, but 11 only
assumes C89 so it now uses AC_CHECK_HEADERS instead of the overly picky
AC_HEADER_STDBOOL.  (I could find no discussion of which historical
systems had <stdbool.h> but failed the conformance test; if they ever
existed, they surely aren't relevant to that policy's goals.)

[1] https://wiki.postgresql.org/wiki/Committing_checklist#Policies

Reported-by: Sam James <sam@gentoo.org>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org> (master version)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (approach)
Discussion: https://www.postgresql.org/message-id/flat/87o72eo9iu.fsf%40gentoo.org

Branch
------
REL_14_STABLE

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

Modified Files
--------------
configure                  | 182 +++++++++++----------------------------------
configure.ac               |  13 +---
src/include/c.h            |   2 +-
src/include/pg_config.h.in |   6 --
src/tools/msvc/Solution.pm |   2 -
5 files changed, 48 insertions(+), 157 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Assume that <stdbool.h> conforms to the C standard.
@ 2024-11-25 07:59 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Munro @ 2024-11-25 07:59 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Assume that <stdbool.h> conforms to the C standard.

Previously we checked "for <stdbool.h> that conforms to C99" using
autoconf's AC_HEADER_STDBOOL macro.  We've required C99 since PostgreSQL
12, so the test was redundant, and under C23 it was broken: autoconf
2.69's implementation doesn't understand C23's new empty header (the
macros it's looking for went away, replaced by language keywords).
Later autoconf versions fixed that, but let's just remove the
anachronistic test.

HAVE_STDBOOL_H and HAVE__BOOL will no longer be defined, but they
weren't directly tested in core or likely extensions (except in 11, see
below).  PG_USE_STDBOOL (or USE_STDBOOL in 11 and 12) is still defined
when sizeof(bool) is 1, which should be true on all modern systems.
Otherwise we define our own bool type and values of size 1, which would
fail to compile under C23 as revealed by the broken test.  (We'll
probably clean that dead code up in master, but here we want a minimal
back-patchable change.)

This came to our attention when GCC 15 recently started using using C23
by default and failed to compile the replacement code, as reported by
Sam James and build farm animal alligator.

Back-patch to all supported releases, and then two older versions that
also know about <stdbool.h>, per the recently-out-of-support policy[1].
12 requires C99 so it's much like the supported releases, but 11 only
assumes C89 so it now uses AC_CHECK_HEADERS instead of the overly picky
AC_HEADER_STDBOOL.  (I could find no discussion of which historical
systems had <stdbool.h> but failed the conformance test; if they ever
existed, they surely aren't relevant to that policy's goals.)

[1] https://wiki.postgresql.org/wiki/Committing_checklist#Policies

Reported-by: Sam James <sam@gentoo.org>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org> (master version)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (approach)
Discussion: https://www.postgresql.org/message-id/flat/87o72eo9iu.fsf%40gentoo.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/13242b64e15d1ecd807382d15c178f31bf460192

Modified Files
--------------
configure                  | 182 +++++++++++----------------------------------
configure.in               |  13 +---
src/include/c.h            |   2 +-
src/include/pg_config.h.in |   6 --
src/tools/msvc/Solution.pm |   2 -
5 files changed, 48 insertions(+), 157 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Assume that <stdbool.h> conforms to the C standard.
@ 2024-11-25 08:00 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Munro @ 2024-11-25 08:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Assume that <stdbool.h> conforms to the C standard.

Previously we checked "for <stdbool.h> that conforms to C99" using
autoconf's AC_HEADER_STDBOOL macro.  We've required C99 since PostgreSQL
12, so the test was redundant, and under C23 it was broken: autoconf
2.69's implementation doesn't understand C23's new empty header (the
macros it's looking for went away, replaced by language keywords).
Later autoconf versions fixed that, but let's just remove the
anachronistic test.

HAVE_STDBOOL_H and HAVE__BOOL will no longer be defined, but they
weren't directly tested in core or likely extensions (except in 11, see
below).  PG_USE_STDBOOL (or USE_STDBOOL in 11 and 12) is still defined
when sizeof(bool) is 1, which should be true on all modern systems.
Otherwise we define our own bool type and values of size 1, which would
fail to compile under C23 as revealed by the broken test.  (We'll
probably clean that dead code up in master, but here we want a minimal
back-patchable change.)

This came to our attention when GCC 15 recently started using using C23
by default and failed to compile the replacement code, as reported by
Sam James and build farm animal alligator.

Back-patch to all supported releases, and then two older versions that
also know about <stdbool.h>, per the recently-out-of-support policy[1].
12 requires C99 so it's much like the supported releases, but 11 only
assumes C89 so it now uses AC_CHECK_HEADERS instead of the overly picky
AC_HEADER_STDBOOL.  (I could find no discussion of which historical
systems had <stdbool.h> but failed the conformance test; if they ever
existed, they surely aren't relevant to that policy's goals.)

[1] https://wiki.postgresql.org/wiki/Committing_checklist#Policies

Reported-by: Sam James <sam@gentoo.org>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org> (master version)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (approach)
Discussion: https://www.postgresql.org/message-id/flat/87o72eo9iu.fsf%40gentoo.org

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/15a89e2cc50198e16be4b73a8921c88c88dd0d1c

Modified Files
--------------
configure                     | 180 ++++++++++--------------------------------
configure.in                  |   7 +-
src/include/c.h               |   4 +-
src/include/pg_config.h.in    |   6 --
src/include/pg_config.h.win32 |   8 --
5 files changed, 45 insertions(+), 160 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Assume that <stdbool.h> conforms to the C standard.
@ 2024-11-25 08:00 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 8+ messages in thread

From: Thomas Munro @ 2024-11-25 08:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Assume that <stdbool.h> conforms to the C standard.

Previously we checked "for <stdbool.h> that conforms to C99" using
autoconf's AC_HEADER_STDBOOL macro.  We've required C99 since PostgreSQL
12, so the test was redundant, and under C23 it was broken: autoconf
2.69's implementation doesn't understand C23's new empty header (the
macros it's looking for went away, replaced by language keywords).
Later autoconf versions fixed that, but let's just remove the
anachronistic test.

HAVE_STDBOOL_H and HAVE__BOOL will no longer be defined, but they
weren't directly tested in core or likely extensions (except in 11, see
below).  PG_USE_STDBOOL (or USE_STDBOOL in 11 and 12) is still defined
when sizeof(bool) is 1, which should be true on all modern systems.
Otherwise we define our own bool type and values of size 1, which would
fail to compile under C23 as revealed by the broken test.  (We'll
probably clean that dead code up in master, but here we want a minimal
back-patchable change.)

This came to our attention when GCC 15 recently started using using C23
by default and failed to compile the replacement code, as reported by
Sam James and build farm animal alligator.

Back-patch to all supported releases, and then two older versions that
also know about <stdbool.h>, per the recently-out-of-support policy[1].
12 requires C99 so it's much like the supported releases, but 11 only
assumes C89 so it now uses AC_CHECK_HEADERS instead of the overly picky
AC_HEADER_STDBOOL.  (I could find no discussion of which historical
systems had <stdbool.h> but failed the conformance test; if they ever
existed, they surely aren't relevant to that policy's goals.)

[1] https://wiki.postgresql.org/wiki/Committing_checklist#Policies

Reported-by: Sam James <sam@gentoo.org>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org> (master version)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (approach)
Discussion: https://www.postgresql.org/message-id/flat/87o72eo9iu.fsf%40gentoo.org

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0305dd3adef24b753201a5a72c8c43b38aee5cbc

Modified Files
--------------
configure                     | 178 ++++++++++--------------------------------
configure.in                  |   4 +-
src/include/pg_config.h.in    |   5 +-
src/include/pg_config.h.win32 |   3 -
4 files changed, 44 insertions(+), 146 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2024-11-25 08:00 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-11-25 07:58 pgsql: Assume that <stdbool.h> conforms to the C standard. Thomas Munro <tmunro@postgresql.org>
2024-11-25 07:58 pgsql: Assume that <stdbool.h> conforms to the C standard. Thomas Munro <tmunro@postgresql.org>
2024-11-25 07:59 pgsql: Assume that <stdbool.h> conforms to the C standard. Thomas Munro <tmunro@postgresql.org>
2024-11-25 07:59 pgsql: Assume that <stdbool.h> conforms to the C standard. Thomas Munro <tmunro@postgresql.org>
2024-11-25 07:59 pgsql: Assume that <stdbool.h> conforms to the C standard. Thomas Munro <tmunro@postgresql.org>
2024-11-25 07:59 pgsql: Assume that <stdbool.h> conforms to the C standard. Thomas Munro <tmunro@postgresql.org>
2024-11-25 08:00 pgsql: Assume that <stdbool.h> conforms to the C standard. Thomas Munro <tmunro@postgresql.org>
2024-11-25 08:00 pgsql: Assume that <stdbool.h> conforms to the C standard. Thomas Munro <tmunro@postgresql.org>

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