Skip to content

Commit

Permalink
[debug] Don't define g_debuglevel in the kernel
Browse files Browse the repository at this point in the history
We only use this constant when `DEBUGLEVEL>=2`, but we get
-Werror=pedantic errors for empty translation units, so still define it
except in kernel environments.

Backport from the kernel:

https://lore.kernel.org/lkml/20230616144400.172683-1-ben.dooks@codethink.co.uk/
  • Loading branch information
Nick Terrell committed Nov 17, 2023
1 parent d8ae0a6 commit 069c518
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/common/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@

#include "debug.h"

#if (DEBUGLEVEL>=2)
int g_debuglevel = DEBUGLEVEL;
#endif

0 comments on commit 069c518

Please sign in to comment.