From 52e5e6b1a73c56837f3ae3398e41ee9d9badc7a5 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Sun, 25 Feb 2024 12:45:30 +0800 Subject: [PATCH] bindgen: set -Wno-unknown-warning-option flag by default Test: presubmit Change-Id: Id8547c0b3263f4e3b060f8b0fce2aef8a494b1b2 --- rust/bindgen.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rust/bindgen.go b/rust/bindgen.go index 85cc220a4..454dd8798 100644 --- a/rust/bindgen.go +++ b/rust/bindgen.go @@ -263,10 +263,9 @@ func (b *bindgenDecorator) GenerateSource(ctx ModuleContext, deps PathDeps) andr // clang: error: '-x c' after last input file has no effect [-Werror,-Wunused-command-line-argument] cflags = append(cflags, "-Wno-unused-command-line-argument") - // LLVM_NEXT may contain flags that bindgen doesn't recognise. Turn off unknown flags warning. - if ctx.Config().IsEnvTrue("LLVM_NEXT") { - cflags = append(cflags, "-Wno-unknown-warning-option") - } + // The Clang version used by CXX can be newer than the one used by Bindgen, and uses warning related flags that + // it cannot recognize. Turn off unknown warning flags warning. + cflags = append(cflags, "-Wno-unknown-warning-option") outputFile := android.PathForModuleOut(ctx, b.BaseSourceProvider.getStem(ctx)+".rs")