[PATCH] D18088: Add a new warning to notify users of mismatched SDK and deployment target

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 27 18:03:14 PDT 2016


rsmith added inline comments.

================
Comment at: lib/Driver/ToolChains.cpp:722
@@ +721,3 @@
+    if (BeginSDK != StringRef::npos && EndSDK != StringRef::npos) {
+      StringRef SDK = isysroot.slice(BeginSDK + 5, EndSDK);
+      if (!SDK.startswith(getPlatformFamily()))
----------------
rsmith wrote:
> According to `slice`'s documentation, if `EndSDK < BeginSDK + 5`, this `slice` call will return a slice from `BeginSDK + 5` to the end of the string, and you won't be checking for a `.sdk` prefix as you intended to.
Huh. That's a bug in `slice`'s documentation (fixed in r267831).


http://reviews.llvm.org/D18088





More information about the cfe-commits mailing list