XCode and LLVM

Discussion in 'Mac Programming' started by Tex-Twil, Dec 12, 2009.

  1. Tex-Twil macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #1
    Hi,
    I was reading the Ars Technica review of Snow Leopard and I have a question about the LVVM and Clang part. In the review they say that the LLVM compiler should report warning/errors more efficiently in xcode as gcc does.

    I wanted to reproduce this:
    [​IMG]

    So I coded that same function in xcode, set the compiler to LLVM GCC 4.2 in the project preferences, build it but I don't see the same result.

    What am I doing wrong ?

    Thanks,
    Tex
     
  2. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #2
    That message doesn't come from the compiler, but from the static analyser.
     
  3. GorillaPaws macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #3
    In other words, don't choose "Build and Run", but instead use "Build and Analyze" from the build menu.
     
  4. Tex-Twil thread starter macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #4
    ok, now I see the message but not the fancy arrows
     
  5. Detrius macrumors 68000

    Joined:
    Sep 10, 2008
    Location:
    Asheville, NC
    #5
    As you said, you're using LLVM GCC 4.2. You need to be using Clang LLVM 1.0, which is what the article is about.
     
  6. Tex-Twil thread starter macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #6
    it's not there even with LLVM 1.0
     
  7. rossipoo macrumors regular

    Joined:
    Jun 7, 2009
    #7
    You must click on the error message for the arrows to appear. And the Analyzer doesn't run itself (unless you specify this in your build settings, which is recommended), so you do need to click Analyze under the Biild menu.
     
  8. Tex-Twil thread starter macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #8
    oh that was the mistake. Thanks :)

    EDIT: ... ouah this is very cool !
     

Share This Page