From 686d64cf05cd93050c215e21d4c3d0ce0f387e2e Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 25 Dec 2020 10:04:02 +0100 Subject: [PATCH] Disable some clang-tidy lints with false positives One warns about using system() which we only use in test code (we're all adults): src/fish_tests.cpp:2015:9: warning: calling 'system' uses a command processor [cert-env33-c] if (system("mkdir -p test/fish_expand_test/bb/")) err(L"mkdir failed"); Some conversion warnings that don't seem very useful: src/input_common.cpp:181:20: warning: 'signed char' to 'wint_t' (aka 'unsigned int') conversion; consider casting to 'unsigned char' first. [cert-str34-c] wint_t b = evt.get_char(); Warning about varargs doesn't make sense, because some of our functions use std::vswprintf() internally. src/ast.cpp:486:10: warning: do not define a C-style variadic function; consider using a function parameter pack or currying instead [cert-dcl50-cpp] void internal_error(const char *func, const wchar_t *fmt, ...) const { Finally, what seems like a false positive; "va" is initialized by va_copy: src/common.cpp:468:18: warning: Function 'vswprintf' is called with an uninitialized va_list argument [clang-analyzer-valist.Uninitialized] status = std::vswprintf(buff, size / sizeof(wchar_t), format, va); --- .clang-tidy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 04783fdb4..b463c3d74 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: 'clang-diagnostic-*,clang-analyzer-*,cert-*,performance-*,portability-*,modernize-use-auto,modernize-loop-convert,modernize-use-bool-literals,modernize-use-using,hicpp-uppercase-literal-suffix,readability-make-member-function-const,readability-redundant-string-init,readability-inconsistent-declaration-parameter-name,readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-cert-dcl37-c,-cert-dcl51-cpp' +Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-valist.Uninitialized,cert-*,performance-*,portability-*,-modernize-use-auto,modernize-loop-convert,modernize-use-bool-literals,modernize-use-using,hicpp-uppercase-literal-suffix,readability-make-member-function-const,readability-redundant-string-init,readability-inconsistent-declaration-parameter-name,readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-cert-dcl37-c,-cert-dcl50-cpp,-cert-dcl51-cpp,-cert-str34-c,-cert-env33-c' WarningsAsErrors: '' HeaderFilterRegex: '' AnalyzeTemporaryDtors: false