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

2025-06-05 Thread Tom Lane
Andres Freund 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_as

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

2025-06-04 Thread Andres Freund
Hi, On 2025-04-25 15:58:29 -0400, Andres Freund wrote: > On 2025-04-25 13:37:15 -0400, Tom Lane wrote: > > Buildfarm member serinus has been producing the identical warning for > > some time. I'd been ignoring that because it runs "experimental gcc", > > but I guess the experiment has leaked out

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

2025-04-25 Thread Andres Freund
Hi, On 2025-04-25 13:37:15 -0400, Tom Lane wrote: > Whilst poking at Erik Rijkers' nearby report, I found that > Fedora 42's gcc 15.0.1 will produce this complaint if you > select optimization level -O3: > > In file included from ../../../../src/include/access/htup_details.h:22, >

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

2025-04-25 Thread Tom Lane
I wrote: > Anybody have an idea about how to silence it more effectively? > There are going to be more people seeing this as gcc 15 propagates. Meh. I tried this: diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index bb99781c56e..ea489db89c9 100644 --- a/src/pl/plpgsql/s

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

2025-04-25 Thread Tom Lane
Whilst poking at Erik Rijkers' nearby report, I found that Fedora 42's gcc 15.0.1 will produce this complaint if you select optimization level -O3: In file included from ../../../../src/include/access/htup_details.h:22, from pl_exec.c:21: In function 'assign_simple_var', inli