diff options
author | Jia Tan <jiat0218@gmail.com> | 2023-12-07 21:48:07 +0800 |
---|---|---|
committer | Jia Tan <jiat0218@gmail.com> | 2023-12-22 20:02:06 +0800 |
commit | 3f51a4415a6d8f9be87512a502161141cd85dffa (patch) | |
tree | 6a00157417d0f74c4ff2a703d5817fa34bf40783 | |
parent | Update THANKS. (diff) | |
download | xz-3f51a4415a6d8f9be87512a502161141cd85dffa.tar.xz |
Tests: Silence -Wsign-conversion warning on GCC version < 10.
Since GCC version 10, GCC no longer complains about simple implicit
integer conversions with Arithmetic operators.
For instance:
uint8_t a = 5;
uint32_t b = a + 5;
Give a warning on GCC 9 and earlier but this:
uint8_t a = 5;
uint32_t b = (a + 5) * 2;
Gives a warning with GCC 10+.
Diffstat (limited to '')
-rw-r--r-- | tests/test_block_header.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_block_header.c b/tests/test_block_header.c index b3101355..10f4af33 100644 --- a/tests/test_block_header.c +++ b/tests/test_block_header.c @@ -320,7 +320,7 @@ test_lzma_block_header_encode(void) uint8_t flags = out[1]; // Should have number of filters = 1 - assert_uint_eq((flags & 0x3) + 1, 1); + assert_uint_eq((flags & 0x3) + 1U, 1); // Bits 2-7 must be empty not set assert_uint_eq(flags & (0xFF - 0x3), 0); |