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

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

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.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-06-05 19:56:19 Re: [19] Proposal: function markers to indicate collation/ctype sensitivity
Previous Message Nathan Bossart 2025-06-05 19:48:59 Re: add function for creating/attaching hash table in DSM registry