From 60d4ef13bac39a1021e44b6b1daeb977ac3e6ba3 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Mon, 10 Dec 2018 16:20:07 +0100 Subject: [PATCH] fix warning as errors outside of ngcore --- CMakeLists.txt | 2 +- libsrc/core/.clang-tidy | 1 + tests/catch/archive.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 185e3fe5..14931c4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -360,7 +360,7 @@ if(ENABLE_CPP_CORE_GUIDELINES_CHECK) message(WARNING "clang-tidy not found.") else() message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") - set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-warnings-as-errors=*" "-header-filter=libsrc/core/") + set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-header-filter=libsrc/core/") endif() endif(ENABLE_CPP_CORE_GUIDELINES_CHECK) diff --git a/libsrc/core/.clang-tidy b/libsrc/core/.clang-tidy index 65b4984d..290188fb 100644 --- a/libsrc/core/.clang-tidy +++ b/libsrc/core/.clang-tidy @@ -2,3 +2,4 @@ Checks: '*,-clang-analyzer-alpha.*,-*braces-around-statements,-fuchsia-*,-google CheckOptions: - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor value: 1 +WarningsAsErrors: '*' \ No newline at end of file diff --git a/tests/catch/archive.cpp b/tests/catch/archive.cpp index f5d38eb2..a5ca80d5 100644 --- a/tests/catch/archive.cpp +++ b/tests/catch/archive.cpp @@ -97,8 +97,8 @@ void testNullPtr(Archive& in, Archive& out) shared_ptr sp = nullptr; out & p & sp; out.FlushBuffer(); - SharedPtrHolder* pin; - shared_ptr spin; + SharedPtrHolder* pin = nullptr; + shared_ptr spin = nullptr; in & pin & spin; CHECK(pin == nullptr); CHECK(spin == nullptr); @@ -186,8 +186,8 @@ void testMultipleInheritance(Archive& in, Archive& out) { out & p & p2; out.FlushBuffer(); - PtrHolder* pin; - SharedPtrHolder* pin2; + PtrHolder* pin = nullptr; + SharedPtrHolder* pin2 = nullptr; in & pin & pin2; checkPtr(pin, pin2); }