Re: silence compiler warning in brin.c

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: silence compiler warning in brin.c
Date: 2022-06-01 16:46:52
Message-ID: CALNJ-vTvL-kvQ0CAbZxOvSR=PuOi1MbtywE=tdG2hhqSnZVkRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 1, 2022 at 9:35 AM Nathan Bossart <nathandbossart(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-06-01 16:52:55 Re: plperl tests fail with latest Perl 5.36
Previous Message Nathan Bossart 2022-06-01 16:35:37 silence compiler warning in brin.c