From e82732916a27faa5f58a01369770caa8c788754f Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Tue, 31 Aug 2021 14:04:18 +0800 Subject: [PATCH] Switch to clang r433403 Bug: 197230471 Test: presubmit Change-Id: I374a66deb785bae99953ea23c67f873f33c2081b --- cc/config/global.go | 10 ++++++++-- cc/tidy.go | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cc/config/global.go b/cc/config/global.go index 977334522..5f41f9e06 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -230,6 +230,9 @@ var ( "-Wno-string-concatenation", // http://b/175068488 // New warnings to be fixed after clang-r428724 "-Wno-align-mismatch", // http://b/193679946 + // New warnings to be fixed after clang-r433403 + "-Wno-error=unused-but-set-variable", // http://b/197240255 + "-Wno-error=unused-but-set-parameter", // http://b/197240255 } // Extra cflags for external third-party projects to disable warnings that @@ -255,6 +258,9 @@ var ( // http://b/165945989 "-Wno-psabi", + + // http://b/199369603 + "-Wno-null-pointer-subtraction", } IllegalFlags = []string{ @@ -268,8 +274,8 @@ var ( // prebuilts/clang default settings. ClangDefaultBase = "prebuilts/clang/host" - ClangDefaultVersion = "clang-r428724" - ClangDefaultShortVersion = "13.0.1" + ClangDefaultVersion = "clang-r433403" + ClangDefaultShortVersion = "13.0.2" // Directories with warnings from Android.bp files. WarningAllowedProjects = []string{ diff --git a/cc/tidy.go b/cc/tidy.go index fefa7f0f1..53ff1564b 100644 --- a/cc/tidy.go +++ b/cc/tidy.go @@ -148,6 +148,9 @@ func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags { tidyChecks = tidyChecks + ",-bugprone-branch-clone" // http://b/193716442 tidyChecks = tidyChecks + ",-bugprone-implicit-widening-of-multiplication-result" + // Too many existing functions trigger this rule, and fixing it requires large code + // refactoring. The cost of maintaining this tidy rule outweighs the benefit it brings. + tidyChecks = tidyChecks + ",-bugprone-easily-swappable-parameters" flags.TidyFlags = append(flags.TidyFlags, tidyChecks) if ctx.Config().IsEnvTrue("WITH_TIDY") {