From ecbf218d6e81752bbcdff75d0a1a154d6f67b296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 18 Sep 2026 11:21:36 +0800 Subject: [PATCH] Chore: fixes compiling errors --- src/common/smbios.h | 2 +- tests/base64.c | 2 +- tests/endian-bigendian.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/smbios.h b/src/common/smbios.h index cd5418f19..7aa0d5048 100644 --- a/src/common/smbios.h +++ b/src/common/smbios.h @@ -100,5 +100,5 @@ typedef const FFSmbiosHeader* FFSmbiosHeaderTable[FF_SMBIOS_TYPE__MAX]; [[nodiscard]] const FFSmbiosHeaderTable* ffGetSmbiosHeaderTable(void); #ifdef __linux__ -[[gnu::nonnull(1, 2, 3), nodiscard]] bool ffGetSmbiosValue(const char* devicesPath, const char* classPath, FFstrbuf* buffer); +[[gnu::nonnull(1, 2, 3)]] bool ffGetSmbiosValue(const char* devicesPath, const char* classPath, FFstrbuf* buffer); #endif diff --git a/tests/base64.c b/tests/base64.c index 5f05f55de..1376fe214 100644 --- a/tests/base64.c +++ b/tests/base64.c @@ -135,7 +135,7 @@ static void verifyRoundTrip(void) { uint32_t decodedLength = 0; memset(decoded, 0, sizeof(decoded)); - VERIFY(ffBase64DecodeRaw(encodedLength, encoded, &decodedLength, decoded)); + ffBase64DecodeRaw(encodedLength, encoded, &decodedLength, decoded); VERIFY(decodedLength == length); VERIFY(memcmp(decoded, source, length) == 0); } diff --git a/tests/endian-bigendian.c b/tests/endian-bigendian.c index 39056bedf..8b76ccf5c 100644 --- a/tests/endian-bigendian.c +++ b/tests/endian-bigendian.c @@ -30,12 +30,12 @@ // reading a big endian value is a no-op ... _Static_assert(FF_READ_BE((uint16_t) 0x1122) == (uint16_t) 0x1122, "FF_READ_BE must be the identity on a big endian host"); _Static_assert(FF_READ_BE(0x11223344u) == 0x11223344u, "FF_READ_BE must be the identity on a big endian host"); -_Static_assert(FF_READ_BE(0x1122334455667788ull) == 0x1122334455667788ull, "FF_READ_BE must be the identity on a big endian host"); +_Static_assert(FF_READ_BE((uint64_t) 0x1122334455667788ull) == (uint64_t) 0x1122334455667788ull, "FF_READ_BE must be the identity on a big endian host"); // ... and reading a little endian one swaps. _Static_assert(FF_READ_LE((uint16_t) 0x1122) == (uint16_t) 0x2211, "FF_READ_LE must swap on a big endian host"); _Static_assert(FF_READ_LE(0x11223344u) == 0x44332211u, "FF_READ_LE must swap on a big endian host"); -_Static_assert(FF_READ_LE(0x1122334455667788ull) == 0x8877665544332211ull, "FF_READ_LE must swap on a big endian host"); +_Static_assert(FF_READ_LE((uint64_t) 0x1122334455667788ull) == (uint64_t) 0x8877665544332211ull, "FF_READ_LE must swap on a big endian host"); int main(void) { // Everything this test asserts is checked at compile time, so reaching this line is the result.