Re: gcc 15 "array subscript 0" warning at level -O3
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-06-05T19:50:48Z
Lists: pgsql-hackers
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. regards, tom lane
Commits
-
Use pg_assume() to avoid compiler warning below exec_set_found()
- 48a23f6eae71 19 (unreleased) landed
-
Add pg_assume(expr) macro
- d65eb5b1b84e 19 (unreleased) landed