]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix -Wunused-variable under FUZZING_BUILD_MODE... 2244/head
authorMitch Phillips <31459023+hctim@users.noreply.github.com>
Tue, 14 Jul 2020 15:49:43 +0000 (08:49 -0700)
committerMitch Phillips <31459023+hctim@users.noreply.github.com>
Tue, 14 Jul 2020 16:03:02 +0000 (09:03 -0700)
Fuzzing build modes (FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) doesn't
necessarily imply that assert() is enabled, according to the manual.

When the current do-nothing is expanded under -Wunused-variable (-Wall),
it results in unused variables in some of the FUZZING_BUILD_MODE...
blocks.

This patch extends the do-nothing to avoid the unused variable.

lib/common/debug.h

index ac6224888d8b7d6918dce8b3ee68e5699103109f..37ce370cf1a75759d8fa5a2774a4083bbd14442a 100644 (file)
@@ -79,7 +79,7 @@ extern "C" {
 #  include <assert.h>
 #else
 #  ifndef assert   /* assert may be already defined, due to prior #include <assert.h> */
-#    define assert(condition) ((void)0)   /* disable assert (default) */
+#    define assert(condition) ((void) (condition))   /* disable assert (default) */
 #  endif
 #endif