Silence several compiler warnings#324
Open
developer79433 wants to merge 5 commits into
Open
Conversation
Silences warnings:
opensprinkler_server.cpp: In function ‘void server_change_board_attrib(const OTF::Request&, char, unsigned char*)’:
opensprinkler_server.cpp:520:41: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
520 | snprintf(tbuf2+1, 3, "%d", bid);
| ^
opensprinkler_server.cpp:520:25: note: ‘snprintf’ output between 2 and 4 bytes into a destination of size 3
520 | snprintf(tbuf2+1, 3, "%d", bid);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
opensprinkler_server.cpp: In function ‘void server_change_stations_attrib(const OTF::Request&, char, unsigned char*)’:
opensprinkler_server.cpp:539:49: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
539 | snprintf(tbuf2+1, 3, "%d", sid);
| ^
opensprinkler_server.cpp:539:33: note: ‘snprintf’ output between 2 and 4 bytes into a destination of size 3
539 | snprintf(tbuf2+1, 3, "%d", sid);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
opensprinkler_server.cpp: In function ‘void server_change_stations(const OTF::Request&, OTF::Response&)’:
opensprinkler_server.cpp:571:41: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
571 | snprintf(tbuf2+1, 3, "%d", sid);
| ^
opensprinkler_server.cpp:571:25: note: ‘snprintf’ output between 2 and 4 bytes into a destination of size 3
571 | snprintf(tbuf2+1, 3, "%d", sid);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Silences warnings:
OpenSprinkler.cpp:2022:18: warning: unused variable ‘stoptime’ [-Wunused-variable]
2022 | uint32_t stoptime = millis()+timeout;
| ^~~~~~~~
OpenSprinkler.cpp: In static member function ‘static void OpenSprinkler::switch_remotestation(RemoteOTCStationData*, bool, uint16_t)’:
OpenSprinkler.cpp:2154:13: warning: unused variable ‘x’ [-Wunused-variable]
2154 | int x = send_http_request(DEFAULT_OTC_SERVER_APP, DEFAULT_OTC_PORT_APP, p, remote_http_callback, true);
| ^
Silences:
mqtt.cpp: In function ‘void subscribe_callback(mosquitto*, void*, const mosquitto_message*)’:
mqtt.cpp:697:15: warning: unused variable ‘topic’ [-Wunused-variable]
697 | char *topic = message->topic;
| ^~~~~
Fixes:
In file included from external/TinyWebsockets/tiny_websockets_lib/include/tiny_websockets/network/linux/linux_tcp_client.hpp:6,
from external/TinyWebsockets/tiny_websockets_lib/include/tiny_websockets/internals/ws_common.hpp:37,
from external/TinyWebsockets/tiny_websockets_lib/include/tiny_websockets/internals/wscrypto/crypto.hpp:3,
from external/TinyWebsockets/tiny_websockets_lib/src/crypto.cpp:1:
external/TinyWebsockets/tiny_websockets_lib/include/tiny_websockets/network/tcp_client.hpp:11:29: error: ‘uint8_t’ does not name a type
11 | virtual void send(const uint8_t* data, const uint32_t len) = 0;
| ^~~~~~~
external/TinyWebsockets/tiny_websockets_lib/include/tiny_websockets/network/tcp_client.hpp:5:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
4 | #include <tiny_websockets/network/tcp_socket.hpp>
+++ |+#include <cstdint>
5 |
Contributor
Author
|
This is failing CI build because it needs #326 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.