Re: silence compiler warning in brin.c - Mailing list pgsql-hackers

From Zhihong Yu
Subject Re: silence compiler warning in brin.c
Date
Msg-id CALNJ-vTvL-kvQ0CAbZxOvSR=PuOi1MbtywE=tdG2hhqSnZVkRw@mail.gmail.com
Whole thread Raw
In response to silence compiler warning in brin.c  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: silence compiler warning in brin.c  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers


On Wed, Jun 1, 2022 at 9:35 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
Hi hackers,

I'm seeing a compiler warning in brin.c with an older version of gcc.
Specifically, it seems worried that a variable might not be initialized.
AFAICT there is no real risk, so I've attached a small patch to silence the
warning.

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
Hi,
It seems the variable can be initialized to the value of GUCNestLevel since later in the func:

    /* Roll back any GUC changes executed by index functions */
    AtEOXact_GUC(false, save_nestlevel);

Cheers

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: silence compiler warning in brin.c
Next
From: Robert Haas
Date:
Subject: Re: plperl tests fail with latest Perl 5.36