From 072291a5282c5dd2c1eebe2e8932d831bbbb3b43 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Sat, 4 Apr 2020 22:48:06 +0200 Subject: clang-tidy: Suppress 'cppcoreguidelines-pro-type-cstyle-cast' warning Also, treat it as an error Change-Id: Ia2918ce83f2b27d8a039d2651c7edc2d40ccdbdc Reviewed-by: Christian Kandeler --- .clang-tidy | 1 + src/plugins/scanner/cpp/cppscanner.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index a1cfad4d5..e11794066 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -57,6 +57,7 @@ Checks: > WarningsAsErrors: > bugprone-*, + cppcoreguidelines-pro-type-cstyle-cast, google-*, misc-unused-*, modernize-*, diff --git a/src/plugins/scanner/cpp/cppscanner.cpp b/src/plugins/scanner/cpp/cppscanner.cpp index 4b7f0eb03..191a0f8d2 100644 --- a/src/plugins/scanner/cpp/cppscanner.cpp +++ b/src/plugins/scanner/cpp/cppscanner.cpp @@ -234,7 +234,7 @@ static void *openScanner(const unsigned short *filePath, const char *fileTags, i opaque->mapl = mapl; void *vmap = mmap(0, s.st_size, PROT_READ, MAP_PRIVATE, opaque->fd, 0); - if (vmap == MAP_FAILED) + if (vmap == MAP_FAILED) // NOLINT(cppcoreguidelines-pro-type-cstyle-cast) return nullptr; #else opaque->file.setFileName(opaque->fileName); -- cgit v1.2.3