From 60d43dbbc8b75ce39fef4375cb83c4f31fa2a55f Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Tue, 24 Sep 2019 12:01:29 +0200 Subject: [PATCH] Fix clang unused-function warnings There are many places inline functions in headers are declared that won't be used so we should suppress the clang warning about that. Change-Id: I01c26f68473543007427e5baafc74eee966c0e68 --- cmake/gmxCFlags.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/gmxCFlags.cmake b/cmake/gmxCFlags.cmake index 3b025a32b7..b0dee1dcd1 100644 --- a/cmake/gmxCFlags.cmake +++ b/cmake/gmxCFlags.cmake @@ -404,6 +404,11 @@ GMX_TEST_CFLAG(CFLAGS_WARN "/W3;/wd161;/wd177;/wd411;/wd593;/wd981;/wd1418;/wd14 endif() GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra;-Wno-missing-field-initializers;-Wpointer-arith;-Wmissing-prototypes" GMXC_CXXFLAGS) GMX_TEST_CXXFLAG(CXXFLAGS_DEPRECATED "-Wdeprecated" GMXC_CXXFLAGS) + # Functions placed in headers for inlining are not always + # used in every translation unit that includes the files, + # so we must disable the warning that there are such + # functions that are unused. + GMX_TEST_CXXFLAG(CXXFLAGS_NO_UNUSED_FUNCTION "-Wno-unused-function" GMXC_CXXFLAGS) endif() if(NOT GMX_OPENMP) GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CXXFLAGS) -- 2.11.4.GIT