Skip to content

Commit 3f832df

Browse files
bjdooks-ctNick Terrell
authored and
Nick Terrell
committed
zstd: fix g_debuglevel export warning
The g_debuglevel variable in debug.c is only used when DEBUGLEVEL is defined to be above 2. This means by default there's no actual definition of this in the headers, so sparse is giving the following warning: lib/zstd/common/debug.c:24:5: warning: symbol 'g_debuglevel' was not declared. Should it be static? We can use the same check as in the header to remove this if it isn't going to be used, silencing the warning and removing a small bit of unused data. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Nick Terrell <terrelln@fb.com>
1 parent 40eb0e9 commit 3f832df

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/zstd/common/debug.c

+2
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@
2222

2323
#include "debug.h"
2424

25+
#if (DEBUGLEVEL>=2)
2526
int g_debuglevel = DEBUGLEVEL;
27+
#endif

0 commit comments

Comments
 (0)