From: Benjamin Kramer Date: Wed, 21 Oct 2009 21:05:07 +0000 (+0000) Subject: Driver: don't produce bogus osx version numbers if no version (aka 0) was specified. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87f9fd90ca08348d2a058c526760688e17208daa;p=clang Driver: don't produce bogus osx version numbers if no version (aka 0) was specified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84781 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index a0fefcdfc1..398e5dddbf 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -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";