diff --git a/t/porting/cpphdrcheck.t b/t/porting/cpphdrcheck.t index 88c7496b0832..861fe176d5c9 100644 --- a/t/porting/cpphdrcheck.t +++ b/t/porting/cpphdrcheck.t @@ -124,7 +124,7 @@ sub find_ccpp ($cc) { # intel C, Sun C # Sun C sends -V output to stderr my $ver = `$cc -V 2>&1`; - unless ($ver) { + if (!$ver || ($? && $ver =~ /\berror\b/)) { # gcc, clang $ver = `$cc --version 2>$devnull`; }