agora inbox for pgsql-committers@postgresql.orghelp / color / mirror / Atom feed
pgsql: Silence uninitialized-variable warning. 2+ messages / 2 participants [nested] [flat]
* pgsql: Silence uninitialized-variable warning. @ 2021-11-07 17:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2021-11-07 17:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Silence uninitialized-variable warning. Quite a few buildfarm animals are warning about this, and lapwing is actually failing (because -Werror). It's a false positive AFAICS, so no need to do more than zero the variable to start with. Discussion: https://postgr.es/m/YYXJnUxgw9dZKxlX@paquier.xyz Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c3ec4f8fe867807613c08fe16789434ab1a74a15 Modified Files -------------- src/backend/access/transam/xlog.c | 3 +++ 1 file changed, 3 insertions(+) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Silence uninitialized variable warning with some compiler versio @ 2026-06-17 06:03 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 2+ messages in thread From: Heikki Linnakangas @ 2026-06-17 06:03 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-06-17 06:03 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-11-07 17:18 pgsql: Silence uninitialized-variable warning. Tom Lane <tgl@sss.pgh.pa.us> 2026-06-17 06:03 pgsql: Silence uninitialized variable warning with some compiler versio Heikki Linnakangas <heikki.linnakangas@iki.fi>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox