Re: gcc 15 "array subscript 0" warning at level -O3

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: gcc 15 "array subscript 0" warning at level -O3
Date: 2025-07-09 23:20:20
Message-ID: edjdgw6wdgee4dsnsscvbvfs7fygrinjvmchig23xtgtgrlc2y@tzf2caovapdi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2025-06-05 15:50:48 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> >> I've been wondering about adding wrapping something like that in a
> >> pg_assume(expr) or such.
>
> > I've been once more annoyed by this warning. Here's a prototype for the
> > approach outlined above.
>
> Looks plausible by eyeball. I did notice a typo in the comment:
>
> + * pg_assume(expr) stats that we assume `expr` to evaluate to true. In assert
>
> s/stats/states/, I think you meant.

Thanks. I pushed it with that tweak and a bit of minor comment burnishing.
Glad to see the last of that warning.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-07-09 23:21:29 Re: gcc 15 "array subscript 0" warning at level -O3
Previous Message Michael Paquier 2025-07-09 23:16:52 Re: Fix comment in btree_gist--1.8--1.9.sql