Re: Debian 12 gcc warning

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Debian 12 gcc warning
Date: 2023-08-29 13:27:23
Message-ID: ZO3yO5qiW9A82zo4@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)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(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

Attachment Content-Type Size
warning.diff text/x-diff 557 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-08-29 13:38:31 Re: logical_replication_mode
Previous Message Melanie Plageman 2023-08-29 13:21:37 Re: Eliminate redundant tuple visibility check in vacuum