From 688f24d0170352b2b87d75ca73f205ca9cbff5d2 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Sat, 22 Nov 2025 12:02:43 -0800 Subject: [PATCH] Silence warning with parse_headers ``` clang -xc++-header -fsyntax-only -c foo.h clang: warning: argument unused during compilation: '-c' [-Wunused-command-line-argument] ``` This just no longer passes the `-c` to the header parsing action --- cc/private/toolchain/unix_cc_toolchain_config.bzl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cc/private/toolchain/unix_cc_toolchain_config.bzl b/cc/private/toolchain/unix_cc_toolchain_config.bzl index 86480f8d..01ff6689 100644 --- a/cc/private/toolchain/unix_cc_toolchain_config.bzl +++ b/cc/private/toolchain/unix_cc_toolchain_config.bzl @@ -522,7 +522,6 @@ def _impl(ctx): ACTION_NAMES.linkstamp_compile, ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, ACTION_NAMES.cpp_module_compile, ACTION_NAMES.cpp_module_codegen, ACTION_NAMES.cpp_module_deps_scanning, @@ -539,6 +538,17 @@ def _impl(ctx): ), ], ), + flag_set( + actions = [ + ACTION_NAMES.cpp_header_parsing, + ], + flag_groups = [ + flag_group( + flags = ["%{source_file}"], + expand_if_available = "source_file", + ), + ], + ), ], )