When trying to build libwebsockets, it fails in lib/core/context.c due to an unused variable. This seems to only occur on release builds. On debug builds, there is no issue.
[cmake] /home/mia/source/odamex/libraries/libwebsockets/lib/core/context.c:1765:20: error: ‘cname’ defined but not used [-Werror=unused-variable]
[cmake] 1765 | static const char *cname[] = { "Unknown", "OK", "Captive", "No internet" };
[cmake] | ^~~~~
In my case LWS_WITH_SYS_STATE is disabled, as is LWS_WITH_NO_LOGS.
|
#if (defined(LWS_WITH_SYS_STATE) && defined(LWS_WITH_SYS_SMD)) || !defined(LWS_WITH_NO_LOGS) |
|
static const char *cname[] = { "Unknown", "OK", "Captive", "No internet" }; |
|
#endif |
As far as I can tell, that means cname is defined, and is used only a few lines later:
|
#if !defined(LWS_WITH_NO_LOGS) |
|
lwsl_cx_info(cx, "setting CPD result %s", cname[result]); |
|
#endif |
So I don't understand why there would be an error for it being unused.
I am using v4.5.2
When trying to build libwebsockets, it fails in
lib/core/context.cdue to an unused variable. This seems to only occur on release builds. On debug builds, there is no issue.In my case
LWS_WITH_SYS_STATEis disabled, as isLWS_WITH_NO_LOGS.libwebsockets/lib/core/context.c
Lines 1764 to 1766 in 85c6f79
As far as I can tell, that means
cnameis defined, and is used only a few lines later:libwebsockets/lib/core/context.c
Lines 1774 to 1776 in 85c6f79
So I don't understand why there would be an error for it being unused.
I am using v4.5.2