[PATCH] cgcc: check sparse options fmax-errors and fmax-warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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.





[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux