[PATCH xserver] squash! sync: Convert from "CARD64" to int64_t.
Keith Packard
keithp at keithp.com
Thu Aug 24 23:27:03 UTC 2017
Eric Anholt <eric at anholt.net> writes:
> ---
>
> We pass the overflow unit tests both before and after this change, but
> this should be safer.
I've seen GCC do precisely the 'optimization' you are concerned about,
but only when one of the operands is constant. One should use -fwrapv
whenever using gcc so that you get correct behavior, instead of
compiler-writers-potluck. I hope the gcc authors agree with your reading
of the spec in this case; it's getting very hard to trust them to ever
do the right thing though.
Reviewed-by: Keith Packard <keithp at keithp.com>
--
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20170824/23a808be/attachment.sig>
More information about the xorg-devel
mailing list