On Wed, Sep 02, 2026 at 08:01:56AM +0200, Andrei Lepikhov wrote: > In my mind, we should pay for CPU cycles only in practical cases. So, if this > case deserves an overflow check, it should be an assertion that consumes no > resources in production.
All the patterns you are showing imply direct function calls, which don't really seem worth bothering about. Are any of these overflow cases reachable using operators with dedicated casts? I would count as OK even cases where the sum functions are used in a custom aggregate, say with a SFUNC set to one of the paths you are pointing at. -- Michael
signature.asc
Description: PGP signature
