From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@bowt.ie>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Uninitialized-variable warnings in nbtinsert.c
Date: Sat, 13 Jun 2020 12:17:40 -0400
Message-ID: <841649.1592065060@sss.pgh.pa.us> (raw)
I scraped the buildfarm's compiler warnings today, as I do from
time to time, and I noticed that half a dozen animals that normally
don't report any uninitialized-variable warnings are complaining
about "curitup" in _bt_doinsert. We traditionally ignore such warnings
from compilers that have demonstrated track records of being stupid
about it, but when a reasonably modern compiler shows such a warning
I think we ought to suppress it. Right now the counts of
uninitialized-variable warnings in HEAD builds are
1 calliphoridae
1 chipmunk
1 coypu
1 culicidae
2 curculio
1 frogfish
25 locust
24 prairiedog
(curculio is additionally whining about "curitemid" in the same function.)
So you can see that this one issue has greatly expanded the set of
compilers that are unhappy. I can see their point too -- it requires
some study to be sure we are assigning curitup before dereferencing it.
The simplest fix would be to just initialize curitup to NULL in its
declaration. But perhaps there's a better way.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, pg@bowt.ie
Subject: Re: Uninitialized-variable warnings in nbtinsert.c
In-Reply-To: <841649.1592065060@sss.pgh.pa.us>
References: <841649.1592065060@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