From 910020aeecf8f991be4dcd399ffbcc054b97fd2d Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 11 Dec 2020 20:18:36 +0100 Subject: [PATCH] Ignore non-useful check in clang-tidy as we have ton of memset/memcpy --- configure.ac | 2 ++ src/common/Makefile.am | 2 +- src/libopensc/Makefile.am | 2 +- src/pkcs11/Makefile.am | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 939434e7..92904ec4 100644 --- a/configure.ac +++ b/configure.ac @@ -953,6 +953,7 @@ AC_PATH_PROG(GENGETOPT, gengetopt, not found) AC_ARG_VAR([CLANGTIDY], [absolute path to clang-tidy used for static code analysis]) AC_PATH_PROG(CLANGTIDY, clang-tidy, not found) +TIDY_CHECKS="-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling" AX_FUNC_GETOPT_LONG #AH_BOTTOM([#include "common/compat_getopt.h"]) @@ -1060,6 +1061,7 @@ AC_SUBST([PROFILE_DIR]) AC_SUBST([PROFILE_DIR_DEFAULT]) AC_SUBST([OPTIONAL_NOTIFY_CFLAGS]) AC_SUBST([OPTIONAL_NOTIFY_LIBS]) +AC_SUBST([TIDY_CHECKS]) AM_CONDITIONAL([ENABLE_MAN], [test "${enable_man}" = "yes"]) AM_CONDITIONAL([ENABLE_THREAD_LOCKING], [test "${enable_thread_locking}" = "yes"]) diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 746492df..c5494015 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -43,4 +43,4 @@ TIDY_FILES = \ libpkcs11.c libscdl.c check-local: - if [ -x "$(CLANGTIDY)" ]; then clang-tidy -config='' -header-filter=.* $(TIDY_FILES) -- $(TIDY_FLAGS); fi + if [ -x "$(CLANGTIDY)" ]; then clang-tidy -config='' --checks='$(TIDY_CHECKS)' -header-filter=.* $(TIDY_FILES) -- $(TIDY_FLAGS); fi diff --git a/src/libopensc/Makefile.am b/src/libopensc/Makefile.am index 1b47d6eb..2cee992d 100644 --- a/src/libopensc/Makefile.am +++ b/src/libopensc/Makefile.am @@ -147,4 +147,4 @@ TIDY_FILES = \ #$(SOURCES) check-local: - if [ -x "$(CLANGTIDY)" ]; then clang-tidy -config='' -header-filter=.* $(TIDY_FILES) -- $(TIDY_FLAGS); fi + if [ -x "$(CLANGTIDY)" ]; then clang-tidy -config='' --checks='$(TIDY_CHECKS)' -header-filter=.* $(TIDY_FILES) -- $(TIDY_FLAGS); fi diff --git a/src/pkcs11/Makefile.am b/src/pkcs11/Makefile.am index 9ea20648..8aeaec58 100644 --- a/src/pkcs11/Makefile.am +++ b/src/pkcs11/Makefile.am @@ -87,4 +87,4 @@ TIDY_FILES = \ framework-pkcs15init.c debug.c check-local: - if [ -x "$(CLANGTIDY)" ]; then clang-tidy -config='' -header-filter=.* $(TIDY_FILES) -- $(TIDY_FLAGS); fi + if [ -x "$(CLANGTIDY)" ]; then clang-tidy -config='' --checks='$(TIDY_CHECKS)' -header-filter=.* $(TIDY_FILES) -- $(TIDY_FLAGS); fi