5 ms·
Would love to see better transparency from Apple with regards to their adoption/flavour of Clang. The current and next versions of Xcode (9.2 and 9.3) still do
by m1h4 9y ago
Would love to see better transparency from Apple with regards to their adoption/flavour of Clang. The current and next versions of Xcode (9.2 and 9.3) still do not support std::variant/std::optional in Cpp17 for example…
- cozzyd 9y agoI can't remember, has Apple bothered enabling thread-local storage in its clang distribution yet?
- ComputerGuru 9y agoThe last time I checked, only for POC. In my uuid library [0], macOS is basically the only one I can’t create a per-thread rng and instead have to spin up a new one each time. 0: https://github.com/neosmart/uuidxx https://github.com/neosmart/uuidxx
- cozzyd 9y agoIt's frustrating, because TLS works fine on vanilla clang or newish gcc on Mac OS x.
- wahern 9y agoFWIW, macOS has arc4random(3) and arc4random_buf(3).
- ComputerGuru 9y agoThank you. It was supposed to be a platform-agnostic uuid library embracing the benefits of C++11 and beyond. But that was a pipe dream :)
- neilc 9y agoApple's clang supports thread_local as of XCode 8: https://stackoverflow.com/questions/28094794/why-does-apple-clang-disallow-c11-thread-local-when-official-clang-supports/29929949#29929949 https://stackoverflow.com/questions/28094794/why-does-apple-...
- cozzyd 9y agoBetter late than never, I suppose. The answer indicates it might be ABI incompatible with upstream clang though? I'm sure that can cause a lot of fun...
- AlexeyBrin 9y agoApple's LLVM and Clang from Xcode 9 are based on version 4.0 of the main LLVM/Clang. You'll need at least LLVM/Clang 5.0 for more C++17 compatibility. To be fair, modern C++ support is not a priority for Apple, their efforts are more toward Swift.
- cozzyd 9y agoIt's fine if it's not a priority, but why ship a crippled compiler when they could ship the upstream compiler? ABI issues maybe? (I've heard from OS X users that XCode updates have broken the string ABI multiple times anyway...). I don't really care too much since I'm not an OS X user, but some people insist on trying to compile/run some of the software I work on on OS X...
- Joky 9y agoTalking of Apple Clang as a crippled compiler comes across as very uneducated opinion to me. It goes through an extensive validation / stabilization for many months before being released. So yes it adds some delay in getting new shiny features, but calling it "crippled" seems like a very much uneducated opinion here. You can have an idea about the integration exactly what version from upstream Apple is integrating by looking at Swift (they somehow have to be in sync). I guess the last Xcode update was: https://github.com/apple/swift-clang/commits/swift-4.1-branch https://github.com/apple/swift-clang/commits/swift-4.1-branc... The next minor update will likely be this one: https://github.com/apple/swift-clang/commits/swift-4.2-branch https://github.com/apple/swift-clang/commits/swift-4.2-branc... ; so judging at the history I bet you'll get a version of clang that is based of clang-5.0 upstream. And likely the next major Xcode (10?) would be based of this: https://github.com/apple/swift-llvm/tree/swift-5.0-branch https://github.com/apple/swift-llvm/tree/swift-5.0-branch ; which is based off clang-6.0. Note that this branch will very likely get many bug fixes in the next ~6 months. (the above are only guesses based on past release, I don't know anything about their current plan or schedule). The Apple engineers will try to build all variants of the Apple OS for all the HW they ship with this new clang-6.0 based branch. The usual process is to fix upstream the development of clang-7.0 and cherry-pick in these branches. So the compiler that you'll get with the next major Xcode, even if based of clang-6.0 will have many/most of the bug-fixes that will be in clang-7.0 (release in July), but not most of the new features (and new bugs!). Caveat: this apply only to ARM64 and X86, of course Apple does not try to backport bugfixes for platform they don't support. (Note that libc++ is handled a bit differently.) Disclaimer: I was part of the Apple clang team until ~1y ago.
- ddavis 9y agoChances are the next macOS upgrade will come with an Xcode upgrade which usually comes with an llvm/clang upgrade... but I do agree with you.
- cozzyd 9y agoThe problem is that Apple uses its own version numbers for clang, making feature detection difficult. See e.g. http://www.agner.org/optimize/vectorclass/read.php?i=156 http://www.agner.org/optimize/vectorclass/read.php?i=156