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

From David Rowley
Subject Re: Debian 12 gcc warning
Date
Msg-id CAApHDvosmrsBB=vJDEwxsAJhdrLXvT-JTPOHw3DG+ERv0w-M7Q@mail.gmail.com
Whole thread Raw
In response to Debian 12 gcc warning  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Debian 12 gcc warning
Re: Debian 12 gcc warning
List pgsql-hackers
On Tue, 29 Aug 2023 at 07:37, Bruce Momjian <bruce@momjian.us> wrote:
>             nargs = 0;
>             foreach(lc, args)
>             {
>                 actual_arg_types[nargs++] = exprType((Node *) lfirst(lc));
>             }

Does it still produce the warning if you form the above more like?

nargs = list_length(args);
for (int i = 0; i < nargs; i++)
    actual_arg_types[i] = exprType((Node *) list_nth(args, i));

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.

David



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Eliminate redundant tuple visibility check in vacuum
Next
From: Bruce Momjian
Date:
Subject: Re: Debian 12 gcc warning