Skip to content

Silence warnings - #30

Open
developer79433 wants to merge 2 commits into
gilmaimon:masterfrom
developer79433:silence-warnings
Open

Silence warnings#30
developer79433 wants to merge 2 commits into
gilmaimon:masterfrom
developer79433:silence-warnings

Conversation

@developer79433

Copy link
Copy Markdown

Fix a compile error and some warnings.

Fixes eg (this is from an OpenSprinkler compile):

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 |
Silences warnings eg:

external/TinyWebsockets/tiny_websockets_lib/src/websockets_client.cpp: In function ‘websockets::HandshakeRequestResult websockets::generateHandshake(const WSString&, const WSString&, const std::vector<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >&)’:
external/TinyWebsockets/tiny_websockets_lib/src/websockets_client.cpp:111:25: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
  111 |         return std::move(result);
      |                ~~~~~~~~~^~~~~~~~
external/TinyWebsockets/tiny_websockets_lib/src/websockets_client.cpp:111:25: note: remove ‘std::move’ call
g++ -std=gnu++14 -DOSPI -DSMTP_OPENSSL -Wall -include string.h -Iexternal/TinyWebsockets/tiny_websockets_lib/include -Iexternal/OpenThings-Framework-Firmware-Library/   -c -o external/TinyWebsockets/tiny_websockets_lib/src/websockets_endpoint.o external/TinyWebsockets/tiny_websockets_lib/src/websockets_endpoint.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant