Re: Compilation error with buildtype = release

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Compilation error with buildtype = release
Date: 2025-07-29 13:06:40
Message-ID: 871543.1753794400@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> writes:
> I am seeing following error only with buildtype = release

Interesting. I noticed skink showing the same thing as a warning,
but no other BF animals have shown it (yet anyway).

> Looking at the function, reltuples is indeed initialized in all the
> cases. All the relevant lines of the function are at least 3 years
> old, but I have started seeing this error only after
> 80aa9848befc13c188d2775a859deaf172fdd3a2.

Yeah. The variable is clearly initialized in all cases where it's
used, but a compiler doing sloppy flow analysis might complain.
I suspect the relevance of 80aa9848b is that when there was a PG_TRY
in the function, these compilers backed off and didn't try to do flow
analysis at all.

> If I make the change as per attached patch, it compiles without an
> error. I don't claim that the patch is the right thing to do, but it
> might provide a hint.

Usually my answer to this sort of thing is to provide an initializer
for the variable. Will fix.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabrice Chapuis 2025-07-29 13:11:43 Re: pg_basebackup and pg_switch_wal()
Previous Message Tom Lane 2025-07-29 12:57:07 Re: C11 / VS 2019