-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
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.
libwebsockets/lib/core/context.c
Lines 1764 to 1766 in 85c6f79
| #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:
libwebsockets/lib/core/context.c
Lines 1774 to 1776 in 85c6f79
| #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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels