]> granicus.if.org Git - clang/commitdiff
Driver: don't produce bogus osx version numbers if no version (aka 0) was specified.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 21 Oct 2009 21:05:07 +0000 (21:05 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 21 Oct 2009 21:05:07 +0000 (21:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84781 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index a0fefcdfc12a19166e28f93b8f01a35f2bf30c2c..398e5dddbf3f9f0a1f54425b4d754f9dc8564353 100644 (file)
@@ -38,7 +38,8 @@ Darwin::Darwin(const HostInfo &Host, const llvm::Triple& Triple,
   DarwinVersion[2] = _DarwinVersion[2];
 
   llvm::raw_string_ostream(MacosxVersionMin)
-    << "10." << DarwinVersion[0] - 4 << '.' << DarwinVersion[1];
+    << "10." << std::max(0, (int)DarwinVersion[0] - 4) << '.'
+    << DarwinVersion[1];
 
   // FIXME: Lift default up.
   IPhoneOSVersionMin = "3.0";