]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
libctf: don't warn about unused fp in ctf_assert
authorNick Alcock <nick.alcock@oracle.com>
Thu, 24 Apr 2025 12:46:08 +0000 (13:46 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 25 Apr 2025 17:07:41 +0000 (18:07 +0100)
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).

libctf/ctf-impl.h

index fc3f934f9bd76f2afb5fac07e2948e21d1060379..4b9518b54382edf4433aa8cacec1d917201ed28a 100644 (file)
@@ -87,7 +87,7 @@ extern "C"
 
 #if defined (ENABLE_LIBCTF_HASH_DEBUGGING) && !defined (NDEBUG)
 #include <assert.h>
-#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__,      \