Re: gcc 15 "array subscript 0" warning at level -O3 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: gcc 15 "array subscript 0" warning at level -O3
Date
Msg-id edjdgw6wdgee4dsnsscvbvfs7fygrinjvmchig23xtgtgrlc2y@tzf2caovapdi
Whole thread Raw
In response to Re: gcc 15 "array subscript 0" warning at level -O3  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2025-06-05 15:50:48 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Fix comment in btree_gist--1.8--1.9.sql
Next
From: Andres Freund
Date:
Subject: Re: gcc 15 "array subscript 0" warning at level -O3