Hi, On 2024-02-13 13:31:22 -0500, Joseph Koshakow wrote: > Attached is a patch that fixes some overflow/underflow hazards that I > discovered in the interval rounding code.
Random, mildly related thought: I wonder if it's time to, again, look at enabling -ftrapv in assert enabled builds. I had looked at that a few years back, and fixed a number of instances, but not all I think. But I think we are a lot closer to avoiding signed overflows everywhere, and it'd be nice to find overflow hazards more easily. Many places are broken even with -fwrapv semantics (which we don't have on all compilers!). Trapping on such overflows makes it far easier to find problems with tools like sqlsmith. Greetings, Andres Freund