From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Subject: Something in our JIT code is screwing up PG_PRINTF_ATTRIBUTE
Date: Thu, 04 Dec 2025 00:19:08 -0500
Message-ID: <986485.1764825548@sss.pgh.pa.us> (raw)
Currently, configure tries "gnu_printf" then "__syslog__" then
"printf" to set PG_PRINTF_ATTRIBUTE. Of late, buildfarm member
fritillary has been issuing warnings like
../../../../src/include/c.h:234:83: warning: 'syslog' is an unrecognized format function type [-Wformat=]
234 | #define pg_attribute_printf(f,a) __attribute__((format(PG_PRINTF_ATTRIBUTE, f, a)))
| ^
../../../../src/include/port.h:233:86: note: in expansion of macro 'pg_attribute_printf'
233 | extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args) pg_attribute_printf(3, 0);
| ^~~~~~~~~~~~~~~~~~~
I hadn't gotten around to looking at that closely, but in the past
week three new animals (borer, skeletonizer, whitefly) have started
doing that too. On inspection, I realize that that's not happening
across our entire tree, but only within src/backend/jit/llvm.
There are at least two things that seem wrong here:
1. The affected platforms are CentOS Stream 9, CentOS Stream 10, and
AlmaLinux 10.0 (so it's not exactly old obsolete stuff). Since those
are all Linux variants, what we *should* be choosing is "gnu_printf",
yet the configure log shows we chose "__syslog__". Why?
2. Something in the LLVM headers on those platforms has evidently
decided that it'd be a brilliant idea to #define "__syslog__" as
"syslog", and that's breaking this. That seems jaw-droppingly
stupid; why'd they do that, and what can we do to work around it?
Presumably, this is breaking the compiler's ability to check format
strings, so it's not cool to just ignore it.
Adding to my confusion, I do not see these warnings on a local
RHEL9 machine, which ought to be pretty equivalent to CentOS 9.
Anybody want to look into this more closely?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
Subject: Re: Something in our JIT code is screwing up PG_PRINTF_ATTRIBUTE
In-Reply-To: <986485.1764825548@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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