<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><div></div><div><br class=""></div><div>Full disclosure:</div><div><br class=""></div><div><div>$ git diff</div><div>diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer</div><div>index 4c8f648..c993282 100755</div><div>--- a/tools/scan-build/ccc-analyzer</div><div>+++ b/tools/scan-build/ccc-analyzer</div><div>@@ -41,10 +41,14 @@ my $Clang;</div><div> my $DefaultCCompiler;</div><div> my $DefaultCXXCompiler;</div><div> my $IsCXX;</div><div>+my $UseXCRUN = 0;</div><div><br class=""></div><div> if (`uname -a` =~ m/Darwin/) {</div><div>   $DefaultCCompiler = 'clang';</div><div>   $DefaultCXXCompiler = 'clang++';</div><div>+  if (-x "/usr/bin/xcrun") {</div><div>+    $UseXCRUN = 1;</div><div>+  }</div><div> } else {</div><div>   $DefaultCCompiler = 'gcc';</div><div>   $DefaultCXXCompiler = 'g++';</div><div>@@ -478,6 +482,7 @@ my $HtmlDir = $ENV{'CCC_ANALYZER_HTML'};</div><div> my %DisabledArchs = ('ppc' => 1, 'ppc64' => 1);</div><div> my %ArchsSeen;</div><div> my $HadArch = 0;</div><div>+my $HasSDK = 0;</div><div><br class=""></div><div> # Process the arguments.</div><div> foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {</div><div>@@ -500,6 +505,12 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {</div><div>     next;</div><div>   }</div><div><br class=""></div><div>+  # On OSX/iOS, record if an SDK path was specified.  This</div><div>+  # is innocuous for other platforms, so the check just happens.</div><div>+  if ($Arg =~ /^-isysroot/) {</div><div>+    $HasSDK = 1;</div><div>+  }</div><div>+</div><div>   # Options with possible arguments that should pass through to compiler.</div><div>   if (defined $CompileOptionMap{$ArgKey}) {</div><div>     my $Cnt = $CompileOptionMap{$ArgKey};</div><div>@@ -644,6 +655,15 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {</div><div>   }</div><div> }</div><div><br class=""></div><div>+# If we are on OSX and have an installation where the</div><div>+# default SDK is inferred by xcrun use xcrun to infer</div><div>+# the SDK.</div><div>+if (not $HasSDK and $UseXCRUN) {</div><div>+  my $sdk = `/usr/bin/xcrun --show-sdk-path -sdk macosx`;</div><div>+  chomp $sdk;</div><div>+  push @CompileOpts, "-isysroot", $sdk;</div><div>+}</div><div>+</div><div> if ($Action eq 'compile' or $Action eq 'link') {</div><div>   my @Archs = keys %ArchsSeen;</div><div>   # Skip the file if we don't support the architectures specified.</div></div></div></body></html>