pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix C23 compiler warning
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix C23 compiler warning
@ 2024-10-22 06:34 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Eisentraut @ 2024-10-22 06:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/95c6a9bf-d306-43d8-b880-664ef08f2944%40eisentraut.org

Branch
------
master

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

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



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

* pgsql: Fix C23 compiler warning
@ 2024-11-26 12:48 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Eisentraut @ 2024-11-26 12:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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@sss.pgh.pa.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_17_STABLE

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

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



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

* pgsql: Fix C23 compiler warning
@ 2024-11-26 12:48 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Eisentraut @ 2024-11-26 12:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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@sss.pgh.pa.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(-)



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


end of thread, other threads:[~2024-11-26 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-10-22 06:34 pgsql: Fix C23 compiler warning Peter Eisentraut <peter@eisentraut.org>
2024-11-26 12:48 pgsql: Fix C23 compiler warning Peter Eisentraut <peter@eisentraut.org>
2024-11-26 12:48 pgsql: Fix C23 compiler warning Peter Eisentraut <peter@eisentraut.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