Skip to content

Commit 6c915a3

Browse files
bjdooks-ctsirlucjan
authored andcommitted
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 <[email protected]> Signed-off-by: Nick Terrell <[email protected]>
1 parent 314b7b2 commit 6c915a3

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)