agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Silence uninitialized variable warning with some compiler versio
Date: Wed, 17 Jun 2026 06:03:18 +0000
Message-ID: <E1wZjMs-000gEu-0b@gemulon.postgresql.org> (raw)
Silence uninitialized variable warning with some compiler versions
The first "if (difffile)" block initializes the startpos variable, and
the second "if (difffile)" block reads it. The second if-condition can
only be true when the first one was true, so the startpos variable is
always initialized when it's used. However, the compiler might not be
able to deduce that, and warn about startpos being used uninitialized.
To silence the warning, rearrange the if-checks. Also, bail out if the
diff file cannot be opened, instead of ignoring it silently.
Author: Mikhail Litsarev <m.litsarev@postgrespro.ru>
Reviewed-by; Ewan Young <kdbase.hack@gmail.com>
Discussion: https://www.postgresql.org/message-id/ee06f058c626cd37babd8c81579ffb1e@postgrespro.ru
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f29299c42b0b7877db0c339147d95524be69b4e6
Modified Files
--------------
src/test/regress/pg_regress.c | 46 ++++++++++++++++++++++---------------------
1 file changed, 24 insertions(+), 22 deletions(-)
view thread (2+ messages)
Message-ID: <E1wZjMs-000gEu-0b@gemulon.postgresql.org>
Permalink: ../E1wZjMs-000gEu-0b@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wZjMs-000gEu-0b@gemulon.postgresql.org
reply
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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Silence uninitialized variable warning with some compiler versio
In-Reply-To: <E1wZjMs-000gEu-0b@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox