Re: Something in our JIT code is screwing up PG_PRINTF_ATTRIBUTE

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Pgsql Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-06T20:40:25Z
Lists: pgsql-hackers

Attachments

Daniel Gustafsson <daniel@yesql.se> writes:
> On 4 Dec 2025, at 19:01, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> On the other hand, aligning the C++ compiler with the C compiler
>> is likely to avoid other problems, so maybe it's better to focus
>> on making that happen.  I'm not sure how we'd do that automatically
>> though.

> It sounds pretty complicated to, with confidence, automatically detect this.

Yeah.  However, selecting different PG_PRINTF_ATTRIBUTE values for
C and C++ mode seems to get the job done.  I've confirmed the attached
silences these warnings for me when mixing-and-matching gcc and clang.

I don't have a lot of faith in the meson.build addition being correct,
though it worked in a simple test.  Anyone want to review that?

			regards, tom lane

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Allow PG_PRINTF_ATTRIBUTE to be different in C and C++ code.