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 <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2016-01-30 08:02:32 +08:00 committed by Dirk Ziegelmeier
parent 1de8d432d4
commit f411a34af5

View File

@ -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)