From: Mitch Phillips <31459023+hctim@users.noreply.github.com> Date: Tue, 14 Jul 2020 15:49:43 +0000 (-0700) Subject: Fix -Wunused-variable under FUZZING_BUILD_MODE... X-Git-Tag: v1.4.7~115^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23b55d6b3e705794613111e9d343adee3c987e02;p=thirdparty%2Fzstd.git Fix -Wunused-variable under FUZZING_BUILD_MODE... 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. --- diff --git a/lib/common/debug.h b/lib/common/debug.h index ac6224888..37ce370cf 100644 --- a/lib/common/debug.h +++ b/lib/common/debug.h @@ -79,7 +79,7 @@ extern "C" { # include #else # ifndef assert /* assert may be already defined, due to prior #include */ -# define assert(condition) ((void)0) /* disable assert (default) */ +# define assert(condition) ((void) (condition)) /* disable assert (default) */ # endif #endif