From 8d8d7784d5fe0dc3cd8d7fbd4196c2337d389fd1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 13 Mar 2019 13:49:13 +0200 Subject: Don't preserve comments (/C) in MSVC preprocessed output This appear to "enable" some additional VC preprocessor bug that are now triggered by the VC 16.0 xsmf_control.h header. --- build2/cc/compile-rule.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'build2/cc/compile-rule.cxx') diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx index 4d6068d..eeaec83 100644 --- a/build2/cc/compile-rule.cxx +++ b/build2/cc/compile-rule.cxx @@ -1529,7 +1529,10 @@ namespace build2 } case compiler_type::msvc: { - pp = "/C"; + // Asking MSVC to preserve comments doesn't really buy us anything + // but does cause some extra buggy behavior. + // + //pp = "/C"; break; } case compiler_type::icc: @@ -1909,8 +1912,6 @@ namespace build2 { case compiler_class::msvc: { - assert (pp != nullptr); - args.push_back ("/nologo"); // See perform_update() for details on overriding the default @@ -1924,7 +1925,8 @@ namespace build2 args.push_back ("/P"); // Preprocess to file. args.push_back ("/showIncludes"); // Goes to stdout (with diag). - args.push_back (pp); // /C (preserve comments). + if (pp != nullptr) + args.push_back (pp); // /C (preserve comments). args.push_back ("/WX"); // Warning as error (see above). msvc_sanitize_cl (args); @@ -3009,7 +3011,7 @@ namespace build2 args.push_back ("/MD"); args.push_back ("/E"); - args.push_back ("/C"); + // args.push_back ("/C"); // See above. msvc_sanitize_cl (args); -- cgit v1.1