Procházet zdrojové kódy

Fixed `-Wparentheses` warning introduced in v5.6.5 (PR #335 by @nuket)

Max Vilimpoc (unu) před 9 roky
rodič
revize
409ca7ee4e
3 změnil soubory, kde provedl 8 přidání a 3 odebrání
  1. 5 0
      CHANGELOG.md
  2. 2 2
      include/ArduinoJson/JsonVariant.hpp
  3. 1 1
      test/CMakeLists.txt

+ 5 - 0
CHANGELOG.md

@@ -1,6 +1,11 @@
 ArduinoJson: change log
 =======================
 
+HEAD
+----
+
+* Fixed `-Wparentheses` warning introduced in v5.6.5 (PR #335 by @nuket)
+
 v5.6.5
 ------
 

+ 2 - 2
include/ArduinoJson/JsonVariant.hpp

@@ -330,8 +330,8 @@ class JsonVariant : public JsonVariantBase<JsonVariant> {
   }
   bool isString() const {
     return _type == Internals::JSON_STRING ||
-           _type == Internals::JSON_UNPARSED && _content.asString &&
-               !strcmp("null", _content.asString);
+           (_type == Internals::JSON_UNPARSED && _content.asString &&
+            !strcmp("null", _content.asString));
   }
 
   // The current type of the variant

+ 1 - 1
test/CMakeLists.txt

@@ -25,7 +25,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
 		-Wformat=2
 		-Winit-self
 		-Wmissing-include-dirs
-		-Wno-parentheses
+		-Wparentheses
 		-Wno-sign-conversion
 		-Wno-unused
 		-Wno-variadic-macros