Re: Debian 12 gcc warning - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Debian 12 gcc warning
Date
Msg-id ZO3yO5qiW9A82zo4@momjian.us
Whole thread Raw
In response to Re: Debian 12 gcc warning  (John Naylor <john.naylor@enterprisedb.com>)
Responses Re: Debian 12 gcc warning
List pgsql-hackers
On Tue, Aug 29, 2023 at 10:26:27AM +0700, John Naylor wrote:
> 
> On Tue, Aug 29, 2023 at 6:56 AM David Rowley <dgrowleyml@gmail.com> wrote:
> >
> > I'm just not sure if it's unable to figure out if at least nargs
> > elements is set or if it won't be happy until all 100 elements are
> > set.
> 
> It looks like the former, since I can silence it on gcc 13 / -O1 by doing:
> 
> /* keep compiler quiet */
> actual_arg_types[0] = InvalidOid;

Agreed, that fixes it for me too.  In fact, assigning to only element 99 or
200 also prevents the warning, and considering the array is defined for
100 elements, the fact is accepts 200 isn't a good thing.  Patch attached.

I think the question is whether we add this to silence a common compiler
but non-default optimization level.  It is the only such case in our
source code right now.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.

Attachment

pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Eliminate redundant tuple visibility check in vacuum
Next
From: Peter Eisentraut
Date:
Subject: Re: logical_replication_mode