From patchwork Sun Oct 11 22:47:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Triplett X-Patchwork-Id: 53037 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9BNAtZO020712 for ; Sun, 11 Oct 2009 23:10:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752558AbZJKW7y (ORCPT ); Sun, 11 Oct 2009 18:59:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752697AbZJKW7y (ORCPT ); Sun, 11 Oct 2009 18:59:54 -0400 Received: from slow3-v.mail.gandi.net ([217.70.178.89]:53198 "EHLO slow3-v.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752558AbZJKW7y (ORCPT ); Sun, 11 Oct 2009 18:59:54 -0400 Received: from relay4-v.mail.gandi.net (relay4-v.mail.gandi.net [217.70.178.78]) by slow3-v.mail.gandi.net (Postfix) with ESMTP id 4B4D53AA51 for ; Mon, 12 Oct 2009 00:48:06 +0200 (CEST) Received: from feather (unknown [76.75.8.40]) by relay4-v.mail.gandi.net (Postfix) with ESMTP id 8F3D4BA0E; Mon, 12 Oct 2009 00:47:13 +0200 (CEST) Date: Sun, 11 Oct 2009 15:47:03 -0700 From: Josh Triplett To: linux-sparse@vger.kernel.org Cc: sparse@chrisli.org Subject: [PATCHv2] Rename -Wall to Wsparse-all, so it doesn't get turned on unintentionally Message-ID: <20091011224618.GA3963@feather> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org diff --git a/cgcc b/cgcc index 995cc05..8005c3c 100755 --- a/cgcc +++ b/cgcc @@ -51,7 +51,7 @@ while (@ARGV) { my $this_arg = ' ' . "e_arg ($_); $cc .= $this_arg unless &check_only_option ($_); - $check .= $this_arg unless &cc_only_option ($_); + $check .= $this_arg; } if ($gendeps) { @@ -88,25 +88,12 @@ exit 0; sub check_only_option { my ($arg) = @_; - return 1 if $arg =~ /^-W(no-?)?(default-bitfield-sign|one-bit-signed-bitfield|cast-truncate|bitwise|typesign|context|undef|ptr-subtraction-blows|cast-to-as|decl|transparent-union|address-space|enum-mismatch|do-while|old-initializer|non-pointer-null|paren-string|return-void)$/; + return 1 if $arg =~ /^-W(no-?)?(default-bitfield-sign|one-bit-signed-bitfield|cast-truncate|bitwise|typesign|context|undef|ptr-subtraction-blows|cast-to-as|decl|transparent-union|address-space|enum-mismatch|do-while|old-initializer|non-pointer-null|paren-string|return-void|sparse-all)$/; return 1 if $arg =~ /^-v(no-?)?(entry|dead)$/; return 0; } # ----------------------------------------------------------------------------- -# Check if an option is for "cc" only. - -sub cc_only_option { - my ($arg) = @_; - # -Wall turns on all Sparse warnings, including experimental and noisy - # ones. Don't include it just because a project wants to pass -Wall to cc. - # If you really want cgcc to run sparse with -Wall, use - # CHECK="sparse -Wall". - return 1 if $arg =~ /^-Wall$/; - return 0; -} - -# ----------------------------------------------------------------------------- # Simple arg-quoting function. Just adds backslashes when needed. sub quote_arg { diff --git a/lib.c b/lib.c index 622b547..963be08 100644 --- a/lib.c +++ b/lib.c @@ -407,7 +407,7 @@ static char **handle_onoff_switch(char *arg, char **next, const struct warning w char *p = arg + 1; unsigned i; - if (!strcmp(p, "all")) { + if (!strcmp(p, "sparse-all")) { for (i = 0; i < n; i++) { if (*warnings[i].flag != WARNING_FORCE_OFF) *warnings[i].flag = WARNING_ON; diff --git a/sparse.1 b/sparse.1 index d7fe444..abc75a2 100644 --- a/sparse.1 +++ b/sparse.1 @@ -20,6 +20,10 @@ off those warnings, pass the negation of the associated warning option, . .SH WARNING OPTIONS .TP +.B \-Wsparse\-all +Turn on all sparse warnings, except for those explicitly disabled via +\fB\-Wno\-something\fR. +.TP .B \-Waddress\-space Warn about code which mixes pointers to different address spaces. diff --git a/validation/specifiers1.c b/validation/specifiers1.c index 86db45d..1a4e1d5 100644 --- a/validation/specifiers1.c +++ b/validation/specifiers1.c @@ -97,5 +97,5 @@ TEST2(double, long) } /* * check-name: valid specifier combinations - * check-command: sparse -Wall $file + * check-command: sparse $file */