fixed and enabled some Clang compiler warnings (#4517)

This commit is contained in:
Oliver Stöneberg 2022-09-29 21:59:02 +02:00 committed by GitHub
parent 6142ba542a
commit 3dfdb409c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View File

@ -69,7 +69,6 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# TODO: fix and enable these warnings - or move to suppression list below
add_compile_options_safe(-Wno-deprecated-copy-dtor)
add_compile_options_safe(-Wno-non-virtual-dtor)
add_compile_options_safe(-Wno-inconsistent-missing-destructor-override) # caused by Qt moc code
add_compile_options_safe(-Wno-unused-exception-parameter)
add_compile_options_safe(-Wno-old-style-cast)
@ -80,7 +79,6 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options_safe(-Wno-covered-switch-default)
add_compile_options_safe(-Wno-shorten-64-to-32)
add_compile_options_safe(-Wno-zero-as-null-pointer-constant) # TODO: enable when warnings are fixed in in simplecpp and tinyxml2
add_compile_options_safe(-Wno-format-nonliteral)
add_compile_options_safe(-Wno-implicit-int-conversion)
add_compile_options_safe(-Wno-double-promotion)
add_compile_options_safe(-Wno-shadow-field)
@ -91,15 +89,13 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options_safe(-Wno-float-conversion)
add_compile_options_safe(-Wno-enum-enum-conversion)
add_compile_options_safe(-Wno-date-time)
add_compile_options_safe(-Wno-conditional-uninitialized)
add_compile_options_safe(-Wno-suggest-override) # TODO: enable when warnings are fixed in in tinyxml2
add_compile_options_safe(-Wno-suggest-destructor-override) # TODO: enable when warnings are fixed in in tinyxml2
add_compile_options_safe(-Wno-extra-semi-stmt) # TODO: enable when warnings are fixed in in tinyxml2
add_compile_options_safe(-Wno-implicitly-unsigned-literal)
add_compile_options_safe(-Wno-tautological-type-limit-compare)
add_compile_options_safe(-Wno-unused-member-function)
add_compile_options(-Wno-disabled-macro-expansion)
add_compile_options_safe(-Wno-bitwise-instead-of-logical) # TODO: fix these
add_compile_options_safe(-Wno-bitwise-instead-of-logical)
# warnings we are not interested in
add_compile_options(-Wno-four-char-constants)
@ -110,7 +106,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options_safe(-Wno-return-std-move-in-c++11)
if(ENABLE_COVERAGE OR ENABLE_COVERAGE_XML)
message(FATAL_ERROR "Do not use clang for generate code coverage. Use gcc.")
message(FATAL_ERROR "Do not use clang to generate code coverage. Use GCC instead.")
endif()
endif()

View File

@ -13,5 +13,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options_safe(tinyxml2_objs -Wno-suggest-override)
target_compile_options_safe(tinyxml2_objs -Wno-suggest-destructor-override)
target_compile_options_safe(tinyxml2_objs -Wno-zero-as-null-pointer-constant)
target_compile_options_safe(tinyxml2_objs -Wno-format-nonliteral)
endif()

View File

@ -86,6 +86,7 @@ public:
Type projectType;
ImportProject();
virtual ~ImportProject() = default;
void selectOneVsConfig(cppcheck::Platform::PlatformType platform);