-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silence several compiler warnings #324
Open
developer79433
wants to merge
5
commits into
OpenSprinkler:master
Choose a base branch
from
developer79433:silence-warnings
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Silence several compiler warnings #324
developer79433
wants to merge
5
commits into
OpenSprinkler:master
from
developer79433:silence-warnings
+12
−10
Conversation
This file contains 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
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 |
This is failing CI build because it needs #326 . |
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.