[WIP] Clean up the warning landscape (#5048)

* suppress a bunch of warnings from third-party code
get rid of one warning in RDKit code

* corrections

* fix the maeparser flags

* remove some more inchi warnings with clang
This commit is contained in:
Greg Landrum
2022-03-01 05:00:25 +01:00
committed by GitHub
parent 240377115a
commit 00f23b5047
4 changed files with 19 additions and 4 deletions

View File

@@ -315,9 +315,9 @@ TEST_CASE("Github #4138: empty query produces non-empty results",
TEST_CASE("Github #4558: GetSubstructMatches() loops at 43690 iterations",
"[substruct][bug]") {
// We need LOTS of water molecules here.
auto num_mols = 22000;
auto num_mols = 22000u;
std::stringstream smi;
for (int i = 1; i < num_mols; ++i) {
for (auto i = 1u; i < num_mols; ++i) {
smi << "[H]O[H].";
}
smi << "[H]O[H]"; // last one (notice we started at 1)

View File

@@ -84,8 +84,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-parentheses -Wno-logical-op-parentheses -Wno-dangling-else -Wno-format")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-return-type -Wno-implicit-function-declaration -Wno-absolute-value -Wno-parentheses -Wno-logical-op-parentheses -Wno-dangling-else -Wno-format")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result -Wformat-overflow=0 -Wformat=0 -Wno-format-security -Wno-implicit-function-declaration")
endif()
rdkit_library(avalon_clib ${avalon_clib_srcs})

View File

@@ -51,10 +51,15 @@ if(RDK_BUILD_MAEPARSER_SUPPORT)
CACHE STRING "MaeParser Include Dir" FORCE)
file(GLOB MAESOURCES "${MAEPARSER_DIR}/*.cpp")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-copy")
endif()
rdkit_library(maeparser ${MAESOURCES} LINK_LIBRARIES ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} SHARED)
install(TARGETS maeparser DESTINATION ${RDKit_LibDir})
set(maeparser_LIBRARIES maeparser ${ZLIB_LIBRARIES})
endif(MAEPARSER_FORCE_BUILD OR (NOT maeparser_FOUND))
include_directories(${maeparser_INCLUDE_DIRS})

View File

@@ -71,8 +71,14 @@ if(RDK_BUILD_INCHI_SUPPORT)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-parentheses -Wno-logical-op-parentheses")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-comment -Wno-parentheses -Wno-logical-op-parentheses -Wno-pointer-bool-conversion -Wno-unused-value -Wno-unsequenced -Wno-constant-logical-operand")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat-overflow=0 -Wformat=0 -Wno-format-security")
endif()
rdkit_library(RDInchiLib inchi.cpp SHARED LINK_LIBRARIES ${INCHI_LIBRARIES}
GraphMol RDGeneral Depictor SubstructMatch SmilesParse )
target_compile_definitions(RDInchiLib PRIVATE RDKIT_RDINCHILIB_BUILD)