Compiling warnings on old GCC
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t48703psql -h localhost -U postgresBuilt from patchset v1 (message #1), July 27, 2026 at 11:53 PM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t48703_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t48703_1 && git checkout t48703_1Patchset v1 (message #1) is on t48703_1
I came across the following compiling warnings on GCC (Red Hat 4.8.5-44)
4.8.5 with 'CFLAGS=-Og'
be-fsstubs.c: In function ‘be_lo_export’:
be-fsstubs.c:537:24: warning: ‘fd’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
if (CloseTransientFile(fd) != 0)
^
In file included from trigger.c:14:0:
trigger.c: In function ‘ExecCallTriggerFunc’:
../../../src/include/postgres.h:314:2: warning: ‘result’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
return (Pointer) X;
^
trigger.c:2316:9: note: ‘result’ was declared here
Datum result;
^
I wonder if this is worth fixing, maybe by a trivial patch like
attached.
Thanks
Richard
On Mon, 6 Nov 2023 at 19:14, Richard Guo <guofenglinux@gmail.com> wrote:
I came across the following compiling warnings on GCC (Red Hat 4.8.5-44)
4.8.5 with 'CFLAGS=-Og'
I wonder if this is worth fixing, maybe by a trivial patch like
attached.
There's some relevant discussion in
/messages/by-id/flat/20220602024243.GJ29853@telsasoft.com
David
On Mon, Nov 6, 2023 at 2:51 PM David Rowley <dgrowleyml@gmail.com> wrote:
On Mon, 6 Nov 2023 at 19:14, Richard Guo <guofenglinux@gmail.com> wrote:
I came across the following compiling warnings on GCC (Red Hat 4.8.5-44)
4.8.5 with 'CFLAGS=-Og'I wonder if this is worth fixing, maybe by a trivial patch like
attached.There's some relevant discussion in
/messages/by-id/flat/20220602024243.GJ29853@telsasoft.com
Ah, thanks for pointing that out. Somehow I failed to follow that
thread.
It seems that the controversial '-Og' coupled with the old GCC version
(4.8) makes it not worth fixing. So please ignore this thread.
Thanks
Richard
Richard Guo <guofenglinux@gmail.com> writes:
On Mon, Nov 6, 2023 at 2:51 PM David Rowley <dgrowleyml@gmail.com> wrote:
There's some relevant discussion in
/messages/by-id/flat/20220602024243.GJ29853@telsasoft.com
It seems that the controversial '-Og' coupled with the old GCC version
(4.8) makes it not worth fixing. So please ignore this thread.
Although nobody tried to enunciate a formal policy in the other thread,
I think where we ended up is that we'd consider suppressing warnings
seen with -Og, but only with reasonably-modern compiler versions.
For LTS compilers we are only going to care about warnings seen with
production flags (i.e., -O2 or better).
regards, tom lane