mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-25 08:17:32 +02:00
Added more warning flags for GCC (as suggested in issue #28)
This commit is contained in:
@ -21,7 +21,7 @@ size_t Print::print(const char s[])
|
||||
size_t Print::print(double value, int digits)
|
||||
{
|
||||
char tmp[32];
|
||||
sprintf(tmp, "%.*lg", digits+1, value);
|
||||
sprintf(tmp, "%.*g", digits+1, value);
|
||||
return print(tmp);
|
||||
}
|
||||
|
||||
|
@ -3,4 +3,32 @@ file(GLOB_RECURSE SRC_FILES *.cpp)
|
||||
|
||||
include_directories(../include)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(
|
||||
-Wall
|
||||
-Wcast-align
|
||||
-Wcast-qual
|
||||
-Wctor-dtor-privacy
|
||||
-Wdisabled-optimization
|
||||
-Wextra
|
||||
-Wformat=2
|
||||
-Winit-self
|
||||
-Wlogical-op
|
||||
-Wmissing-include-dirs
|
||||
-Wno-parentheses
|
||||
-Wno-unused
|
||||
-Wno-variadic-macros
|
||||
-Wnoexcept
|
||||
-Wold-style-cast
|
||||
-Woverloaded-virtual
|
||||
-Wpedantic
|
||||
-Wredundant-decls
|
||||
-Wshadow
|
||||
-Wsign-promo
|
||||
-Wstrict-null-sentinel
|
||||
-Wstrict-overflow=5
|
||||
-Wundef
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(ArduinoJson ${SRC_FILES} ${INC_FILES})
|
@ -71,13 +71,13 @@ void JsonContainer::removeChild(JsonNode* childToRemove)
|
||||
|
||||
size_t JsonContainer::size() const
|
||||
{
|
||||
int size = 0;
|
||||
int n = 0;
|
||||
|
||||
for (JsonNodeIterator it = beginChildren(); it != endChildren(); ++it)
|
||||
{
|
||||
size++;
|
||||
n++;
|
||||
}
|
||||
|
||||
return size;
|
||||
return n;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user