From 069c518dff7da5736c7ccc0b10b2c48bd55b3e70 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Thu, 16 Nov 2023 17:15:25 -0800 Subject: [PATCH] [debug] Don't define g_debuglevel in the kernel 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/ --- lib/common/debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/common/debug.c b/lib/common/debug.c index ebf7bfccfa6..7e740aafa1a 100644 --- a/lib/common/debug.c +++ b/lib/common/debug.c @@ -21,4 +21,6 @@ #include "debug.h" +#if (DEBUGLEVEL>=2) int g_debuglevel = DEBUGLEVEL; +#endif