Re: Debian 12 gcc warning

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Debian 12 gcc warning
Date: 2023-08-28 23:55:48
Message-ID: CAApHDvosmrsBB=vJDEwxsAJhdrLXvT-JTPOHw3DG+ERv0w-M7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 29 Aug 2023 at 07:37, Bruce Momjian <bruce(at)momjian(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2023-08-29 00:44:15 Re: Debian 12 gcc warning
Previous Message Melanie Plageman 2023-08-28 23:49:27 Eliminate redundant tuple visibility check in vacuum