You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My gcc compiler flags are as follows:
-Wall -Wextra -Wno-unused-result
And compile the latest source code of jsoncpp, and get the following warnings:
[ 33%] Building CXX object json_reader.cpp.o
json_reader.cpp: In member function ‘bool Json::Reader::pushError(const Json::Value&, const string&)’:
json_reader.cpp:834:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp:835:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp: In member function ‘bool Json::Reader::pushError(const Json::Value&, const string&, const Json::Value&)’:
json_reader.cpp:850:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp:851:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp:852:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
[ 66%] Building CXX object json_value.cpp.o
json_value.cpp: In copy constructor ‘Json::Value::CZString::CZString(const Json::Value::CZString&)’:
json_value.cpp:179:26: warning: enumeral and non-enumeral type in conditional expression [enabled by default]
My gcc compiler flags are as follows:
-Wall -Wextra -Wno-unused-result
And compile the latest source code of jsoncpp, and get the following warnings:
[ 33%] Building CXX object json_reader.cpp.o
json_reader.cpp: In member function ‘bool Json::Reader::pushError(const Json::Value&, const string&)’:
json_reader.cpp:834:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp:835:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp: In member function ‘bool Json::Reader::pushError(const Json::Value&, const string&, const Json::Value&)’:
json_reader.cpp:850:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp:851:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp:852:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
[ 66%] Building CXX object json_value.cpp.o
json_value.cpp: In copy constructor ‘Json::Value::CZString::CZString(const Json::Value::CZString&)’:
json_value.cpp:179:26: warning: enumeral and non-enumeral type in conditional expression [enabled by default]
PATCH
src/lib_json/json_reader.cpp | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp
index 1b2f187..c5111f8 100644
--- a/src/lib_json/json_reader.cpp
+++ b/src/lib_json/json_reader.cpp
@@ -831,8 +831,9 @@ std::vectorReader::StructuredError Reader::getStructuredErrors() const {
}
bool Reader::pushError(const Value& value, const std::string& message) {
return false;
Token token;
token.type_ = tokenError;
@@ -847,9 +848,10 @@ bool Reader::pushError(const Value& value, const std::string& message) {
}
bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) {
return false;
Token token;
token.type_ = tokenError;
src/lib_json/json_value.cpp | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp
index b6ea8ff..b4af62b 100644
--- a/src/lib_json/json_value.cpp
+++ b/src/lib_json/json_value.cpp
@@ -170,13 +170,17 @@ Value::CZString::CZString(const char* cstr, DuplicationPolicy allocate)
: cstr_(allocate == duplicate ? duplicateStringValue(cstr) : cstr),
index_(allocate) {}
-Value::CZString::CZString(const CZString& other)
+}
Value::CZString::~CZString() {
if (cstr_ && index_ == duplicate)
The text was updated successfully, but these errors were encountered: