From: Nick Alcock Date: Thu, 24 Apr 2025 12:46:08 +0000 (+0100) Subject: libctf: don't warn about unused fp in ctf_assert X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab3ad58be9a1b8719fc06bb361288c0fcd8a4069;p=thirdparty%2Fbinutils-gdb.git libctf: don't warn about unused fp in ctf_assert When hash debugging is enabled and NDEBUG is not set, ctf_assert() translates into a true assert(). Don't leave the fp parameter unused in this case (which can cause compiler errors when -Werror is also on). --- diff --git a/libctf/ctf-impl.h b/libctf/ctf-impl.h index fc3f934f9bd..4b9518b5438 100644 --- a/libctf/ctf-impl.h +++ b/libctf/ctf-impl.h @@ -87,7 +87,7 @@ extern "C" #if defined (ENABLE_LIBCTF_HASH_DEBUGGING) && !defined (NDEBUG) #include -#define ctf_assert(fp, expr) (assert (expr), 1) +#define ctf_assert(fp, expr) (assert (expr), fp || 1) #else #define ctf_assert(fp, expr) \ _libctf_unlikely_ (ctf_assert_internal (fp, __FILE__, __LINE__, \