[PATCH] D11896: [clang-cl] Add support for CL and _CL_ environment variables

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 09:33:46 PDT 2015

hans added a subscriber: hans.
hans accepted this revision.
hans added a reviewer: hans.
hans added a comment.

Out of curiosity, did you run in to something that relies on this in the wild?

Comment at: tools/driver/driver.cpp:452
@@ +451,3 @@
+    // The first instance of '#' should be replaced with '='.
+    auto AdjustOpt = [] (const char *Opt) {
+      if (char *NumberSignPtr = const_cast<char *>(::strchr(Opt, '#')))
Maybe don't take the parameter as a const char* if the constness needs to be dropped for the adjusting to take place? The const_cast could just be moved to where you make the call below.


More information about the cfe-commits mailing list