From: Yann Collet Date: Tue, 26 Jun 2018 21:08:35 +0000 (-0700) Subject: switched to a sizeof() version X-Git-Tag: v1.3.5~3^2~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1211%2Fhead;p=thirdparty%2Fzstd.git switched to a sizeof() version avoid -Werror=unused-variable issue --- diff --git a/lib/common/debug.h b/lib/common/debug.h index 9b5878cfc..0c04ad2cc 100644 --- a/lib/common/debug.h +++ b/lib/common/debug.h @@ -58,8 +58,9 @@ extern "C" { /* static assert is triggered at compile time, leaving no runtime artefact, - * but can only work with compile-time constants */ -#define DEBUG_STATIC_ASSERT(c) { extern char DEBUG_static_assert[(c) ? 1 : -1]; } + * but can only work with compile-time constants. + * This variant can only be used inside a function. */ +#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1]) /* DEBUGLEVEL is expected to be defined externally,