Closed sbc100 closed 6 months ago
isn't this #2389 ?
INT_MIN/etc are notorious for being a pain as a numeric constant, the usual workaround is to write it as an expression (-2147483647 - 1).
(something about it being technically UB?)
Ah yes, I think #2389 will fix this. My fix was to append .0
which also seems to work.
-fsanitize=undefined
doesn't warn here..
Closing as duplicate of #2388
For some reason INT_MIN is not parsing correctly under MSVC..
Under MSVC this produces:
i.e. only adding
.0
at the end causes the sign bit to be preserved.Gcc and clang both (correctly I believe) produce: