Re: [COMMITTERS] pgsql: Close some holes in BRIN page assignment - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [COMMITTERS] pgsql: Close some holes in BRIN page assignment
Date
Msg-id 20150812233156.GF21836@awork2.anarazel.de
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Close some holes in BRIN page assignment  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [COMMITTERS] pgsql: Close some holes in BRIN page assignment  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On 2015-08-12 16:08:08 -0300, Alvaro Herrera wrote:
> Alvaro Herrera wrote:
> > Close some holes in BRIN page assignment
> 
> buildfarm evidently didn't like this one :-(

clang seems to see a (the?) problem:

/home/andres/src/postgresql/src/backend/access/brin/brin_pageops.c:357:6: warning: variable 'extended' is used
uninitializedwhenever 'if'     condition is false [-Wsometimes-uninitialized]       if (!BufferIsValid(*buffer))
  ^~~~~~~~~~~~~~~~~~~~~~~
 
/home/andres/src/postgresql/src/backend/access/brin/brin_pageops.c:371:6: note: uninitialized use occurs here       if
(extended)          ^~~~~~~~
 
/home/andres/src/postgresql/src/backend/access/brin/brin_pageops.c:357:2: note: remove the 'if' if its condition is
alwaystrue       if (!BufferIsValid(*buffer))       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
/home/andres/src/postgresql/src/backend/access/brin/brin_pageops.c:330:16: note: initialize the variable 'extended' to
silencethis warning       bool            extended;
 

Looks to me like it's right. That also explains why it's failing on a
fairly random selection of platforms and compilers...

Andres



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Test code is worth the space
Next
From: Andres Freund
Date:
Subject: Re: Macro nesting hell