From ab0f7d309c8505d6392fb33af3d633489e0c5c45 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Tue, 9 Jun 2026 08:58:58 -0700 Subject: [PATCH] [build] Extract C++-only warning flags in GN compiler configs Several C++-only warning suppressions were incorrectly placed in the shared 'default_warning_flags' list instead of 'default_warning_flags_cc'. This caused these flags (such as -Wno-microsoft-unqualified-friend, -Wno-microsoft-cast) to be applied to pure C targets (like zlib and BoringSSL assembly). This CL moves these C++-only warnings to 'default_warning_flags_cc', ensuring they are only applied to C++ compilation units. This improves compile database accuracy, prevents IDE/clangd from surfacing phantom diagnostics on C files, and makes the build configuration explicit and robust. Change-Id: I117de03496164d7e2e39b5deab7754fd85452923 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510181 Commit-Queue: Kevin Moore Reviewed-by: Ryan Macnak Auto-Submit: Kevin Moore --- build/config/compiler/BUILD.gn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index b31bb88ce44..18feb4698f9 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -639,11 +639,13 @@ if (is_win) { "-Wno-ignored-pragma-optimize", # icu, double-conversion "-Wno-macro-redefined", "-Wno-microsoft-cast", - "-Wno-microsoft-unqualified-friend", "-Wno-unknown-argument", # icu "-Wno-unused-value", # crashpad "-Wno-deprecated-non-prototype", # zlib ] + default_warning_flags_cc += [ + "-Wno-microsoft-unqualified-friend", + ] } else { default_warning_flags += [ # Permanent.