News for hackers. Stuff that matters.
Re:Clang and FSF's strategy by jordigh on Wednesday January 22, 2014 @11:35AM (#7103626)
So it is easily replaceable? You could easily tell xcode to use gcc if gcc supported the same kind of static analysis? How would you do this?
Re:Clang and FSF's strategy by breser on Wednesday January 22, 2014 @12:30PM (#7104035)
Yes it's replaceable. I've used it with newer builds from the open source project. They even provide binaries and instructions: http://clang-analyzer.llvm.org/xcode.html

If by replaceable you mean using some other analyzer, I'd say it's not easily replaceable but if you can produce an analyzer that produces similar output and that's has the same options, then sure. clang in fact did that sort of thing with their gcc driver.

Re:Clang and FSF's strategy by msbarnett on Wednesday January 22, 2014 @01:21PM (#7104376)
If GCC supported that (and if Xcode supported GCC's support of it), you'd probably tell Xcode to use it the same way you tell Xcode to build with GCC instead of clang: You'd select the option in your project settings.

Nobody's made the claim that Xcode is some kind of magical dynamic IDE that supports arbitrary hypothetical features of arbitrary hypothetical versions of arbitrary compilers that you can mix and match on the fly.

Nevertheless it is the case that Xcode allows you to select between clang and GCC 4.2 backends.

Re:Clang and FSF's strategy by breser on Wednesday January 22, 2014 @11:50PM (#7107034)
GCC support in XCode has been less and less GCC and more and more just the LLVM cleverly disguised as GCC. With XCode5 there is nothing left from the actual GCC project, even gdb has been entirely replaced with lldb. So now if you chose GCC in XCode you're not really using GCC at all.
Re:Clang and FSF's strategy by kps on Wednesday January 22, 2014 @11:50AM (#7103761)
I don't work for Apple and have never seen Xcode source, but my guess (based on what I would do) would be that Xcode invokes Clang/LLVM as libraries rather than a standalone binary, in order to keep persistent state. In principle GCC could present such an interface, but in practice FSF policies prevent it. The point is that the static analysis can be used directly or by other tools (there is a web interface, for instance); it is not restricted to Xcode.
Re:Clang and FSF's strategy by jordigh on Wednesday January 22, 2014 @12:12PM (#7103907)
So... it's not apparently possible without modifying the source code. So like I said originally, what Xcode is using for static analysis is apparently Apple's choice, not yours nor mine.
Re:Clang and FSF's strategy by kps on Wednesday January 22, 2014 @12:44PM (#7104134)
Yes; what's the point? Nobody's making you use Xcode (I don't), and nobody's stopping you using the Clang/LLVM features like static analysis outside of Xcode. If you want, you're free to call clang's static analysis from GNUstep's Xcode clone¹ (assuming GNUstep's license allows that; LLVM's certainly does), or any other IDE or editor.

¹https://github.com/gnustep/gnustep-xcode