Guillermo Rodriguez Garcia <[email protected]> writes:
> El El sáb, 4 jul 2026 a las 21:10, Paul Eggert via tz <[email protected]>
> escribió:
>> Although a cast would be safe in this case, verifying that it's safe
>> requires too much thinking. I want a knowledgeable reader to be able to
>> look at just that line of code and trivially say "yeah, that's benign"
>> while muttering a few choice words about clueless compilers.
>>
>> How about replacing "+" with "~~"? That is, something like the first
>> attached draft patch.
> That requires much more thinking than (int) IMHO.
Yeah, I don't think any of these alternatives --- including the
existing "+" --- is really simpler than a cast. Fundamentally,
what this statement wants to do is arithmetic on these constants,
so how is it not treating them as integers at bottom?
I'm not really in a position to test whether MSVC would be happy
with this. I don't use Windows, so my only test option would be
to commit the change into Postgres and see what our buildfarm
does with it, which is churn I'd rather not put into our commit
history.
regards, tom lane