Ramin created this revision.
Ramin added a reviewer: clang-tools-extra.
Herald added subscribers: steakhal, ASDenysPetrov, dkrupp, donat.nagy, 
Szelethus, a.sidorin, baloghadamsoftware.
Ramin requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

when an unknown paramater is used when running scan-build

it just prints "could not find clang line"

this patch shows the error message


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101159

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


Index: clang/tools/scan-build/libexec/ccc-analyzer
===================================================================
--- clang/tools/scan-build/libexec/ccc-analyzer
+++ clang/tools/scan-build/libexec/ccc-analyzer
@@ -39,11 +39,19 @@
 
   # Invoke 'system', STDOUT and STDERR are output to a temporary file.
   system $Command, @_;
+  my $ret = $?;
 
   # Restore STDOUT and STDERR.
   open STDOUT, ">&", \*OLDOUT;
   open STDERR, ">&", \*OLDERR;
 
+  if ($ret != 0) {
+    print "failed to run $Command \n";
+    while(<$TmpFH>){
+       print $_;
+    }
+  }
+
   return $TmpFH;
 }
 


Index: clang/tools/scan-build/libexec/ccc-analyzer
===================================================================
--- clang/tools/scan-build/libexec/ccc-analyzer
+++ clang/tools/scan-build/libexec/ccc-analyzer
@@ -39,11 +39,19 @@
 
   # Invoke 'system', STDOUT and STDERR are output to a temporary file.
   system $Command, @_;
+  my $ret = $?;
 
   # Restore STDOUT and STDERR.
   open STDOUT, ">&", \*OLDOUT;
   open STDERR, ">&", \*OLDERR;
 
+  if ($ret != 0) {
+    print "failed to run $Command \n";
+    while(<$TmpFH>){
+       print $_;
+    }
+  }
+
   return $TmpFH;
 }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to