From 44d186ecb148ac7b6c5bce26a1d41ff45abc5cdd Mon Sep 17 00:00:00 2001 From: fpagliughi Date: Mon, 26 Jun 2023 14:27:24 -0400 Subject: [PATCH] #425 Enable build warnings, and fix the existing ones. --- src/CMakeLists.txt | 8 ++++++++ src/mqtt/client.h | 2 +- src/mqtt/server_response.h | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3d435955..d3160f04 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -77,6 +77,14 @@ target_include_directories(paho-cpp-objs src ) +# --- Warnings --- + +# Maybe set '-Werror' for Release builds? +target_compile_options(paho-cpp-objs PRIVATE + $<$:/W3> + $<$:-Wall -Wextra -Wdocumentation> + $<$>:-Wall -Wextra> +) ## --- Build the shared library, if requested --- diff --git a/src/mqtt/client.h b/src/mqtt/client.h index 6900aed6..7b7d19c1 100644 --- a/src/mqtt/client.h +++ b/src/mqtt/client.h @@ -231,7 +231,7 @@ class client : private callback */ virtual topic get_topic(const string& top, int qos=message::DFLT_QOS, bool retained=message::DFLT_RETAINED) { - return topic(cli_, top); + return topic(cli_, top, qos, retained); } /** * Determines if this client is currently connected to the server. diff --git a/src/mqtt/server_response.h b/src/mqtt/server_response.h index a1118390..a97f3bdf 100644 --- a/src/mqtt/server_response.h +++ b/src/mqtt/server_response.h @@ -190,7 +190,7 @@ class unsubscribe_response : public server_response } } - unsubscribe_response(MQTTAsync_successData* rsp) {} + unsubscribe_response(MQTTAsync_successData* /*rsp*/) {} public: /**