diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-10-22 08:12:43 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-10-22 08:17:42 +0200 |
commit | d2b4b4c2259e21ceaf05e393769b69728bfbee99 (patch) | |
tree | 556bab7423786c643a2b35765aebde5885483f7d /src | |
parent | 45e0ba30fc40581f320fac17ad8b4e0676e1b3b5 (diff) | |
download | postgresql-d2b4b4c2259e21ceaf05e393769b69728bfbee99.tar.gz postgresql-d2b4b4c2259e21ceaf05e393769b69728bfbee99.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/include/nodes/pathnodes.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h index 07e2415398e..add0f9e45fc 100644 --- a/src/include/nodes/pathnodes.h +++ b/src/include/nodes/pathnodes.h @@ -1107,6 +1107,9 @@ typedef struct IndexOptInfo IndexOptInfo; #define HAVE_INDEXOPTINFO_TYPEDEF 1 #endif +struct IndexPath; /* avoid including pathnodes.h here */ +struct PlannerInfo; /* avoid including pathnodes.h here */ + struct IndexOptInfo { pg_node_attr(no_copy_equal, no_read, no_query_jumble) @@ -1206,7 +1209,7 @@ struct IndexOptInfo bool amcanmarkpos; /* AM's cost estimator */ /* Rather than include amapi.h here, we declare amcostestimate like this */ - void (*amcostestimate) () pg_node_attr(read_write_ignore); + void (*amcostestimate) (struct PlannerInfo *, struct IndexPath *, double, Cost *, Cost *, Selectivity *, double *, double *) pg_node_attr(read_write_ignore); }; /* |