Commit 93180046 authored by Lev Walkin's avatar Lev Walkin

remove undefined behavior

parent 0995f351
......@@ -277,14 +277,14 @@ main() {
CHECK_ROUNDTRIP(value, 4, 0);
}
for(size_t i = 0; i < 8 * sizeof(intmax_t) ; i++) {
for(size_t i = 0; i < 8 * sizeof(intmax_t) - 1; i++) {
intmax_t value = (intmax_t)1 << i;
CHECK_ROUNDTRIP(value, 8, 0);
value = -value;
CHECK_ROUNDTRIP(value, 8, 0);
}
for(size_t i = 0; i < 8 * sizeof(intmax_t) ; i++) {
for(size_t i = 0; i < 8 * sizeof(intmax_t) - 1; i++) {
intmax_t value = (intmax_t)1 << i;
CHECK_ROUNDTRIP(value, 0, 0);
value = -value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment