Skip to contentSkip to conversation

cgcc: do not die on '-x assembler'

PATCH New Luc Van Oostenryck 1 participant 1 message Jun 6, 2022 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cgcc: do not die on '-x assembler'

From: Luc Van Oostenryck <[email protected]>

Currently cgcc will die if the option '-x' is used with any argument other than 'c'.

It makes sense since sparse can only handle C files but it can be useful in a project to simply use something like:
make CC=cgcc

So, instead of die()ing, avoid calling sparse if such '-x' option is used, like already done by default for non .c files.

---
 cgcc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
cgcc +2 -3
index 733cadfa5dfe..618ba08a7b03 100755
@@ -42,11 +42,10 @@ while (@ARGV) {
 	$nargs = 1;
     }
 
-    # Ignore the extension if '-x c' is given.
+    # We don't want to run the checker on non-C files.
     if ($_ eq '-x') {
 	die ("$0: missing argument for $_") if !@ARGV;
-	die ("$0: invalid argument for $_") if $ARGV[0] ne 'c';
-	$do_check = 1;
+	$do_check = ($ARGV[0] eq 'c');
 	$nargs = 1;
     }
 
Signature · 1 line
2.36.1