diff options
author | Michael Forney <mforney@mforney.org> | 2021-09-29 14:51:49 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2021-09-29 15:04:44 -0700 |
commit | cb697da1d5c36ac4e75e554cbc279674dd7075f4 (patch) | |
tree | 9008074de873285abb083cfc66f5c324caa26e08 /test/builtin-expect.c | |
parent | dbdab3ac59af6469e715f8ce9dfe3fdfc523cddf (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/builtin-expect.c')
0 files changed, 0 insertions, 0 deletions