From f411a34af5e3068e519fe31c01e7faad0a61e989 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sat, 30 Jan 2016 08:02:32 +0800 Subject: [PATCH] stats: Add proper #if guard to prevent unused-variable warning for memp_names The usages of memp_names are under either LWIP_DEBUG in stats_init, or under LWIP_STATS_DISPLAY in stats_display_memp. Fix below build warning: lwip/src/core/stats.c:53:21: error: 'memp_names' defined but not used [-Werror=unused-variable] static const char * memp_names[] = { ^ cc1: all warnings being treated as errors Reported-by: David Fernandez Fixes: 2f2a75a6d9fd ("stats: Move memp_names table out of stats_init/stats_display_memp functions") Signed-off-by: Axel Lin --- src/core/stats.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/stats.c b/src/core/stats.c index 6e32faeb..b47ab0b7 100644 --- a/src/core/stats.c +++ b/src/core/stats.c @@ -49,12 +49,14 @@ struct stats_ lwip_stats; +#if defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY #if MEMP_STATS static const char * memp_names[] = { #define LWIP_MEMPOOL(name,num,size,desc) desc, #include "lwip/priv/memp_std.h" }; #endif /* MEMP_STATS */ +#endif /* LWIP_DEBUG || LWIP_STATS_DISPLAY */ void stats_init(void)