versions since 0.199 fail to compile?

My process is:
- download and uncompress (Mac OSX 10.5.7)
- cd to my development directory
- xcodebuild clean; ~/development/checker-0.195/scan-build -k -V xcodebuild

Version 0.195 compiles and produces a webpage of results.

Versions 0.199, 0.204, and 0.208 all fail during compilation with multiple occurrences of this message:

  could not find clang-cc line

Thanks,
Gary

Bump... I just tried 210. Same problem.

Thanks,
Gary

Hi Gary,

I've been really busy with some other things over the last few weeks, and 0.210 just contains a few opportunistic bug fixes to the analyzer. I haven't forgotten about you.

I suspect what is happening is that a compiler option that ccc-analyzer doesn't recognize is being mishandled. This periodically has been a problem, and the plan over the next few weeks is to rewrite ccc-analyzer to directly use Clang's internal driver library (which processes compiler options) instead of having a hackish Perl script layered on top of the Clang driver. The result of this work (which we anticipate won't be too hard) is that a most of these problems will just be defined away.

I'm going to try and take a look a this soon. Thanks for your patience!

Ted

Thanks, Ted! Here’s a fix he sent that worked for me:

— ccc-analyzer (revision 72966)
+++ ccc-analyzer (working copy)
@@ -108,7 +108,7 @@
close(TO_PARENT);
my $line;
while (<FROM_CHILD>) {

  • next if (!/clang-cc/);
  • next if (!(/clang-cc/ || /gcc/));
    $line = $_;
    }

@@ -126,7 +126,7 @@
$items[$i] =~ s/"$//;
}
my $cmd = shift @items;

  • die “cannot find ‘clang-cc’ in ‘clang’ command\n” if (!($cmd =~ /clang-cc/));
  • die “cannot find ‘clang-cc’ in ‘clang’ command\n” if (!($cmd =~ /clang-cc/ || $cmd =~ /gcc/));
    return @items;
    }

Following the patch, I then saw this error, which I hadn’t seen with previous versions that worked for me:

clang-cc: Unknown command line argument ‘-arch’. Try: ‘/Users/Gary/Development/checker-0.210/libexec/clang-cc --help’

It was solved (again, thanks Ted) by running with:

xcodebuild clean; ~/development/checker-0.210/scan-build -k -V xcodebuild -sdk iphonesimulator2.2

–Gary

Hi Gary,

I have a feeling that the ‘-sdk iphonesimulator2.2’ is all that did the trick. If you remove the changes to ccc-analyzer, does it still work?

Ted

Hey, that worked. And I checked; it also works for the previous versions that “broke.”

Whoa! The guy debugs by feelings! :slight_smile:

So summarizing: if you see “could not find clang-cc line”, then try adding ‘-sdk iphonesimulator2.2’ to the xcodebuild command. Eg:

xcodebuild clean; ~/development/checker-0.210/scan-build -k -V xcodebuild -sdk iphonesimulator2.2

…or whatever the approprate SDK is. I’m guessing that the allowed names are given by the .sdk files found in:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
/Developer/SDKs/

Thanks,
Gary

Available SDKs can be listed with:
$ xcodebuild -showsdks

- Daniel