Re: headerscheck warnings with late-model gcc
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-08-07T14:15:19Z
Lists: pgsql-hackers
Attachments
- 0001-headerscheck-Use-ICU_CFLAGS.patch (text/plain) patch 0001
- 0002-headerscheck-Ignore-llvmjit_backport.h.patch (text/plain) patch 0002
- 0003-headerscheck-Ignore-Windows-specific-header.patch (text/plain) patch 0003
- 0004-headerscheck-Ignore-ecpg-test-header.patch (text/plain) patch 0004
On 06.08.25 21:11, Tom Lane wrote: > Peter Eisentraut <peter@eisentraut.org> writes: >> On 05.08.25 20:09, Tom Lane wrote: >>> Curiously, no such complaints appear with cpluspluscheck (which is >>> using g++ 15.1.1). I don't really understand why not ... > >> -Wmissing-variable-declarations is added by us as of PG18 (commit >> 66188912566). It's available since gcc 14 and doesn't exist for C++. > > Oh! Okay, that explains the lack of messages, but it still seems > like an odd omission. Yeah, this is pretty much my fault for not checking this for the above commit. I've been having a hard time getting headerscheck to work reliably in my environment, so I ended up relying on CI, which doesn't have new-enough compilers yet (and/or doesn't run it everywhere; the clang on the FreeBSD task might have caught it (but we also don't have this integrated with meson yet)). Attached are three patches to fix some unrelated problems with headerscheck in my environment. The fourth one is to fix the ecpg issue; I think we can ignore it under the "code fragment" category. kwlist_d.h doesn't show up in my run, probably because I'm using a separate build directory, which headerscheck doesn't handle? Another thing to fix. But I guess it would also fall under the code fragment category? But the code fragment exception is also faulty, because we plausibly do want to check that file for C++ compatibility, just not necessarily as a standalone file. Not sure how to cover all these bases at once.
Commits
-
Silence -Wmissing-variable-declarations in headerscheck.
- 8722e7965fd2 19 (unreleased) landed
-
headerscheck: Document that --with-llvm is required
- f5d07085822a 19 (unreleased) landed
-
headerscheck: Ignore Windows-specific header
- da0413373c09 19 (unreleased) landed
-
headerscheck: Use ICU_CFLAGS
- 664e0d678965 19 (unreleased) landed
-
Add -Wmissing-variable-declarations to the standard compilation flags
- 66188912566b 18.0 cited