[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #47012] Builds may fail due to unused static variable
From: |
David Fernandez |
Subject: |
[lwip-devel] [bug #47012] Builds may fail due to unused static variable memp_names in stats.c |
Date: |
Fri, 29 Jan 2016 16:39:10 +0000 |
User-agent: |
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 |
URL:
<http://savannah.nongnu.org/bugs/?47012>
Summary: Builds may fail due to unused static variable
memp_names in stats.c
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: david0fc
Submitted on: Fri 29 Jan 2016 16:39:09 GMT
Category: pbufs
Severity: 3 - Normal
Item Group: Compiler Warning
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release:
lwIP version: git head
_______________________________________________________
Details:
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 <address@hidden>
----
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.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?47012>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #47012] Builds may fail due to unused static variable memp_names in stats.c,
David Fernandez <=