Linux-Sparse Archive mirror
 help / color / mirror / Atom feed
From: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
To: linux-sparse@vger.kernel.org
Cc: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Subject: [PATCH] cgcc: check sparse options fmax-errors and fmax-warnings
Date: Tue,  3 Sep 2024 08:12:57 +0200	[thread overview]
Message-ID: <20240903061257.648402-1-dmitrii.golovanov@intel.com> (raw)

Recognize sparse command-line options `-fmax-errors` and `-fmax-warnings`
as "check" options:

  `-fmax-warnings` - dont pass it to CC neither with integer value,
    nor as 'unlimited'.
  `-fmax-errors` - only as 'unlimited' value to avoid 'unrecognized
    command-line option' GCC error which also accepts it as numeric.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
---
 cgcc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cgcc b/cgcc
index 618ba08a..b90e9428 100755
--- a/cgcc
+++ b/cgcc
@@ -129,6 +129,8 @@ sub check_only_option {
     return 1 if $arg =~ /^-W(no-?)?(address-space|bitwise|cast-to-as|cast-truncate|constant-suffix|context|decl|default-bitfield-sign|designated-init|do-while|enum-mismatch|external-function-has-definition|init-cstring|memcpy-max-count|non-pointer-null|old-initializer|one-bit-signed-bitfield|override-init-all|paren-string|ptr-subtraction-blows|return-void|sizeof-bool|sparse-all|sparse-error|transparent-union|typesign|undef|unknown-attribute)$/;
     return 1 if $arg =~ /^-v(no-?)?(entry|dead)$/;
     return 1 if $arg =~ /^-f(dump-ir|memcpy-max-count|diagnostic-prefix)(=\S*)?$/;
+    return 1 if $arg =~ /^-fmax-errors=unlimited$/;  # don't pass it to GCC
+    return 1 if $arg =~ /^-fmax-warnings=(unlimited|[0-9]+)$/;
     return 1 if $arg =~ /^-f(mem2reg|optim)(-enable|-disable|=last)?$/;
     return 1 if $arg =~ /^-msize-(long|llp64)$/;
     return 0;
-- 
2.25.1

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


                 reply	other threads:[~2024-09-03  6:13 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=20240903061257.648402-1-dmitrii.golovanov@intel.com \
    --to=dmitrii.golovanov@intel.com \
    --cc=linux-sparse@vger.kernel.org \
    /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).