From: Stephan Rohmen <26538486+srohmen@users.noreply.github.com> Date: Wed, 19 Apr 2023 14:16:03 +0000 (+0200) Subject: fix: Limit MSVC debug flag detection to documented parameters (#1263) X-Git-Tag: v4.8.1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81af12b308a19eec2e426a7e725846cf42cecec4;p=thirdparty%2Fccache.git fix: Limit MSVC debug flag detection to documented parameters (#1263) --- diff --git a/src/argprocessing.cpp b/src/argprocessing.cpp index f300e7bd7..54507724c 100644 --- a/src/argprocessing.cpp +++ b/src/argprocessing.cpp @@ -610,9 +610,13 @@ process_option_arg(const Context& ctx, if (config.is_compiler_group_msvc() && !config.is_compiler_group_clang() && util::starts_with(arg, "-Z")) { - state.last_seen_msvc_z_option = args[i]; - state.common_args.push_back(args[i]); - return Statistic::none; + // Exclude other options starting with /Z (/Zc), which are not debug flags + const char debug_mode = arg[2]; + if (debug_mode == 'i' || debug_mode == '7' || debug_mode == 'I') { + state.last_seen_msvc_z_option = args[i]; + state.common_args.push_back(args[i]); + return Statistic::none; + } } // These options require special handling, because they behave differently