Skip to content

Commit e101c97

Browse files
committed
[clang][scan-build] Warn about unusable CCC_CC and CCC_CXX option values
To avoid user confusion when we're ignoring the provided option and use a default instead.
1 parent 6806e42 commit e101c97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clang/tools/scan-build/libexec/ccc-analyzer

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ sub SearchInPath {
8383
my $opt = $ENV{$is_cxx ? 'CCC_CXX' : 'CCC_CC'};
8484
return $default unless defined $opt;
8585
my ($comp, @args) = shellwords($opt);
86-
return !-x $comp && !SearchInPath($comp) ? $default : ($comp, @args);
86+
if (!-x $comp && !SearchInPath($comp)) {
87+
warn "Can't execute '$comp'. Falling back to '$default'.\n";
88+
return $default;
89+
}
90+
return ($comp, @args);
8791
}
8892
}
8993

0 commit comments

Comments
 (0)