diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-10 06:35:17 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-10 06:35:17 +0000 |
| commit | 0f035e208e267fd9744567c115ea043f3d18a1da (patch) | |
| tree | f52c23e5502662aba9f2566007bfa65ab51f17a5 | |
| parent | 6392eb18b6f76e528e42d247c66f447778de102d (diff) | |
util/nvmutil: assert two's compliment integers
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 106dfd6a..786ba040 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -54,6 +54,9 @@ typedef char static_assert_uint8_is_1[(sizeof(uint8_t) == 1) ? 1 : -1]; typedef char static_assert_uint16_is_2[(sizeof(uint16_t) == 2) ? 1 : -1]; typedef char static_assert_uint32_is_4[(sizeof(uint32_t) == 4) ? 1 : -1]; typedef char static_assert_int_ge_32[(sizeof(int) >= 4) ? 1 : -1]; +typedef char static_assert_twos_complement[ + ((-1 & 3) == 3) ? 1 : -1 +]; /* * We set _FILE_OFFSET_BITS 64, but we only handle |
