Files
xen/tools/tests
Edwin Török 5a37699956 tools/tests/x86_emulator: fix 'shifting a negative signed value is undefined'
clang-21 refuses to compile this:
```
test_x86_emulator.c:1164:24: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
 1164 |     regs.r8     = (-1L << 40) + 1;
      |                    ~~~ ^
1 error generated.
```

The shift could also exceed the width of the type on some systems.
I confirmed that both the old and the new code would produce the same value
with GCC on x86-64: `0xffffff0000000001`.

Signed-off-by: Edwin Török <edwin.torok@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2026-02-24 10:30:05 +01:00
..
2025-12-17 17:35:24 +00:00
2025-10-09 11:09:25 +02:00
2025-12-17 17:35:24 +00:00