Compiling warnings on old GCC

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Compiling warnings on old GCC
Date: 2023-11-06 06:14:00
Message-ID: CAMbWs49XuQiUHcydQrd3JoMSb+nDE23io4gAhy9Ybqk7tvG5KA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v1-0001-Silence-old-compiler-about-Wmaybe-uninitialized.patch application/octet-stream 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2023-11-06 06:18:52 Re: Add new option 'all' to pg_stat_reset_shared()
Previous Message torikoshia 2023-11-06 06:09:28 Re: Add new option 'all' to pg_stat_reset_shared()