Compiling warnings on old GCC - Mailing list pgsql-hackers

From Richard Guo
Subject Compiling warnings on old GCC
Date
Msg-id CAMbWs49XuQiUHcydQrd3JoMSb+nDE23io4gAhy9Ybqk7tvG5KA@mail.gmail.com
Whole thread Raw
Responses Re: Compiling warnings on old GCC
List 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

pgsql-hackers by date:

Previous
From: torikoshia
Date:
Subject: Re: Add new option 'all' to pg_stat_reset_shared()
Next
From: Bharath Rupireddy
Date:
Subject: Re: Add new option 'all' to pg_stat_reset_shared()