From d00b31f48c643c971f78c8be1ae0a834203d6dc4 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 5 Jun 2019 09:36:35 -0700 Subject: [PATCH] [clang] also skip blacklisted flags when passed as -flag=arg Summary: There's currently no way to skip these when they are passed to clang. Reviewed By: martintrojer Differential Revision: D15669132 fbshipit-source-id: be97d2638 --- infer/src/clang/ClangCommand.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infer/src/clang/ClangCommand.ml b/infer/src/clang/ClangCommand.ml index 2b7405f95..2af358aa2 100644 --- a/infer/src/clang/ClangCommand.ml +++ b/infer/src/clang/ClangCommand.ml @@ -122,7 +122,10 @@ let filter_and_replace_unsupported_args ?(replace_options_arg = fun _ s -> s) ?( L.external_warning "Error reading argument file '%s': %s@\n" at_argfile (Exn.to_string e) ; aux in_argfiles' (false, at_argfile :: res_rev, changed) tl ) - | flag :: tl when List.mem ~equal:String.equal Config.clang_blacklisted_flags flag -> + | flag :: tl + when List.mem ~equal:String.equal Config.clang_blacklisted_flags flag + || List.mem ~equal:String.equal Config.clang_blacklisted_flags_with_arg + (String.split ~on:'=' flag |> List.hd |> Option.value ~default:"") -> aux in_argfiles (false, res_rev, true) tl | flag :: tl when List.mem ~equal:String.equal Config.clang_blacklisted_flags_with_arg flag -> (* remove the flag and its arg separately in case we are at the end of an argfile *)