warmcat / libwebsockets

canonical libwebsockets.org networking library

Home Page:https://libwebsockets.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unused variable date compile error when building with LWS_WITH_NO_LOGS

Drise13 opened this issue · comments

In my container build I got the following error:

[ 86%] Building C object minimal-examples/http-client/minimal-http-client-certinfo/CMakeFiles/lws-minimal-http-client-certinfo.dir/minimal-http-client-certinfo.c.o
#15 209.0 /amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libwebsockets/build/src/project_libwebsockets/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c: In function 'callback_http':
#15 209.0 /amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libwebsockets/build/src/project_libwebsockets/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c:30:7: error: unused variable 'date' [-Werror=unused-variable]
#15 209.0    30 |  char date[32];
#15 209.0       |       ^~~~
#15 209.0 cc1: all warnings being treated as errors

In my cmake of amazon-kinesis-video-streams-webrtc-sdk-c, I added LWS_WITH_NO_LOGS=1 to the external project cmake import. This seems to cause the unused variable error.

This was fixed in main a while ago

#if defined(LWS_HAVE_CTIME_R) && !defined(LWS_WITH_NO_LOGS)
        char date[32];
#endif

I applied the same fix to v4.3-stable