Closed GoogleCodeExporter closed 9 years ago
Yes our implementation used this undefined behavior.
Line 1103 -static_cast<int64>(value); tries to cast an uint64 to int64. If the
uint64 is 0x8000000000000000, we will have a minimum int64. Negation of minimum
negative value is an undefined behavior and compiler will "cast to an unsigned
type to negate this value to itself"
It reports undefined behavior because you used the detector. We prefer not fix
it unless there are some compilers which do not keep the value as it is when
"negation of the minimum negative"
Thanks,
Jie
Original comment by jie...@google.com
on 21 Aug 2014 at 11:28
Original comment by jie...@google.com
on 26 Aug 2014 at 3:28
Original issue reported on code.google.com by
robert.e...@gmail.com
on 21 Aug 2014 at 6:32