Fri 29 Jan 2016 04:39:09 PM UTC, original submission:
The code changes for revision (sorry, I'm using hg plugin for git, so the hash is: 978321cd2f6c699b390c56b41b209b33b72dd4ec, and the unique hg changeset is: 978321cd2f6c):
2016-01-14 15:18:57 +0800
stats: Move memp_names table out of stats_init/stats_display_memp functions
This makes the code simpler with better readability.
Also make memp_names static because it's only referenced by stats.c.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Introduced this change:
@@ -49,15 +49,18 @@
struct stats_ lwip_stats;
+#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 */
+
That defines memp_names on MEMP_STATS != 0, but the usages of this are under either LWIP_DEBUG in stats_init, or under LWIP_STATS_DISPLAY in stats_display_memp.
So, with the default values for all the macros here, it causes a 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
In some build systems, the warnings are forbidden, and there are policies to avoid unneeded variables, and blah, blah, blah...
So, if any maintainer could sort this out when possible, that would be great.
I might be happy to submit a patch to the developers list myself, if you prefer that.
|