Linux-Sparse Archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <lucvoo@kernel.org>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Tom Rix <trix@redhat.com>
Subject: [PATCH] cgcc: do not die on '-x assembler'
Date: Tue,  7 Jun 2022 01:46:36 +0200	[thread overview]
Message-ID: <20220606234636.34972-1-lucvoo@kernel.org> (raw)

From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

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.

Original-patch-by: Tom Rix <trix@redhat.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 cgcc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/cgcc b/cgcc
index 733cadfa5dfe..618ba08a7b03 100755
--- a/cgcc
+++ b/cgcc
@@ -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;
     }
 
-- 
2.36.1


                 reply	other threads:[~2022-06-06 23:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220606234636.34972-1-lucvoo@kernel.org \
    --to=lucvoo@kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).