pgsql: Fix C23 compiler warning

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix C23 compiler warning
Date: 2024-11-26 12:48:32
Message-ID: E1tFuzY-003bsS-97@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix C23 compiler warning

The approach of declaring a function pointer with an empty argument
list and hoping that the compiler will not complain about casting it
to another type no longer works with C23, because foo() is now
equivalent to foo(void).

We don't need to do this here. With a few struct forward declarations
we can supply a correct argument list without having to pull in
another header file.

(This is the only new warning with C23. Together with the previous
fix a67a49648d9, this makes the whole code compile cleanly under C23.)

Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://www.postgresql.org/message-id/flat/95c6a9bf-d306-43d8-b880-664ef08f2944%40eisentraut.org
Discussion: https://www.postgresql.org/message-id/flat/87o72eo9iu.fsf%40gentoo.org

Branch
------
REL_16_STABLE

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

Modified Files
--------------
src/include/nodes/pathnodes.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Álvaro Herrera 2024-11-26 16:47:06 pgsql: Clean up newlines following left parentheses
Previous Message Peter Eisentraut 2024-11-26 07:52:03 pgsql: Improve InitShmemAccess() prototype