Skip to content

Commit 2bc6137

Browse files
committed
fix gcc warnings
1 parent 201904b commit 2bc6137

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ endif( MSVC )
8585

8686
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
8787
# using regular Clang or AppleClang
88-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
88+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
8989
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
9090
# using GCC
91-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
91+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -Wpedantic")
9292
endif()
9393

9494
IF(JSONCPP_WITH_WARNING_AS_ERROR)

include/json/value.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,10 @@ Json::Value obj_value(Json::objectValue); // {}
505505
#endif
506506
} value_;
507507
ValueType type_ : 8;
508-
int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
508+
unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
509509
#ifdef JSON_VALUE_USE_INTERNAL_MAP
510510
unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container.
511-
int memberNameIsStatic_ : 1; // used by the ValueInternalMap container.
511+
unsigned int memberNameIsStatic_ : 1; // used by the ValueInternalMap container.
512512
#endif
513513
CommentInfo* comments_;
514514

src/lib_json/json_value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ Value::Value(const Value& other)
340340
case stringValue:
341341
if (other.value_.string_) {
342342
value_.string_ = duplicateStringValue(other.value_.string_);
343-
allocated_ |= true;
343+
allocated_ = true;
344344
} else {
345345
value_.string_ = 0;
346346
allocated_ = false;

src/test_lib_json/jsontest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ void Runner::listTests() const {
323323
}
324324

325325
int Runner::runCommandLine(int argc, const char* argv[]) const {
326-
typedef std::deque<std::string> TestNames;
326+
// typedef std::deque<std::string> TestNames;
327327
Runner subrunner;
328328
for (int index = 1; index < argc; ++index) {
329329
std::string opt = argv[index];

src/test_lib_json/jsontest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ TestResult& checkStringEqual(TestResult& result,
214214
#define JSONTEST_ASSERT_PRED(expr) \
215215
{ \
216216
JsonTest::PredicateContext _minitest_Context = { \
217-
result_->predicateId_, __FILE__, __LINE__, #expr \
217+
result_->predicateId_, __FILE__, __LINE__, #expr, nullptr, nullptr \
218218
}; \
219219
result_->predicateStackTail_->next_ = &_minitest_Context; \
220220
result_->predicateId_ += 1; \

0 commit comments

Comments
 (0)