Re: Fix C23 compiler warning

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix C23 compiler warning
Date: 2024-10-20 15:56:55
Message-ID: 1333354.1729439815@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> This no longer works because in C23, because an empty argument list is
> now equivalent to (void), rather than an indeterminate one as before.
> And so this results in an incompatible function pointer type and
> compiler warnings. (gcc and clang agree on this.)

> I think we can fix this easily with a few struct forward declarations,
> preserving the goal of not including extra header files, like this:

Do the struct declarations themselves need comments? Other
places do this like

struct PlannerInfo; /* avoid including pathnodes.h here */

LGTM other than that nit.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michel Pelletier 2024-10-20 16:32:13 Using Expanded Objects other than Arrays from plpgsql
Previous Message Joel Jacobson 2024-10-20 14:52:15 Re: Add pg_ownerships and pg_privileges system views