aboutsummaryrefslogtreecommitdiff
path: root/test/basic.qbe
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-09-29 14:51:49 -0700
committerMichael Forney <mforney@mforney.org>2021-09-29 15:04:44 -0700
commitcb697da1d5c36ac4e75e554cbc279674dd7075f4 (patch)
tree9008074de873285abb083cfc66f5c324caa26e08 /test/basic.qbe
parentdbdab3ac59af6469e715f8ce9dfe3fdfc523cddf (diff)
eval: Avoid implementation-defined unsigned to signed conversions
Instead, use an additional int64_t member in the union. Since exact-width integer types have no padding bits or trap representations, and use two's-complement representation, we can portably access an int64_t union member stored as uint64_t and vice-versa. This allows us to reinterpret the value without invoking potentially implementation-defined behavior of casting an unsigned integer to a signed integer type which may not be able to represent its value.
Diffstat (limited to 'test/basic.qbe')
0 files changed, 0 insertions, 0 deletions