clang-tidy: Enable most bugprone checks
authorRoland Schulz <roland.schulz@intel.com>
Sun, 20 May 2018 07:16:52 +0000 (00:16 -0700)
committerRoland Schulz <roland.schulz@intel.com>
Sat, 23 Jun 2018 21:21:43 +0000 (14:21 -0700)
Change-Id: I63f3cdd76e1d4a5141cca62b8ed03e36251a68b4

src/gromacs/CMakeLists.txt
src/gromacs/mdtypes/inputrec.cpp

index 6252b7e13f44579eedf03742f9b3ac142c846e5c..3c5fa7d627b2f7d2317070f183034e32e3180ccf 100644 (file)
@@ -273,7 +273,7 @@ if (GMX_CLANG_TIDY)
    if(CMAKE_VERSION VERSION_LESS "3.6")
        message(ERROR "clang-tidy support requires cmake 3.6.")
    endif()
-   set_target_properties(libgromacs PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};--checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-core.NullDereference;-warnings-as-errors=*")
+   set_target_properties(libgromacs PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};--checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-core.NullDereference,bugprone-*,-bugprone-integer-division;-warnings-as-errors=*")
 endif()
 
 gmx_write_installed_header_list()
index 76c6be5472da3248f2aa87ef0814554b3626e6c6..b8e1194080dcdea90e684a13a89c48929f96d7a9 100644 (file)
@@ -72,7 +72,7 @@ const int nstmin_harmonic          = 20;
 
 t_inputrec::t_inputrec()
 {
-    std::memset(this, 0, sizeof(*this));
+    std::memset(this, 0, sizeof(*this)); // NOLINT(bugprone-undefined-memory-manipulation)
     snew(fepvals, 1);
     snew(expandedvals, 1);
     snew(simtempvals, 1);