aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cgcc
diff options
authorJosh Triplett <josh@freedesktop.org>2007-05-01 20:46:47 -0700
committerJosh Triplett <josh@freedesktop.org>2007-05-01 20:49:27 -0700
commite18c1014449adf42520daa9d3e53f78a3d98da34 (patch)
tree1e31db322fef8de93f7bd9276b2ce529027a939d /cgcc
parent1e46b4a2e4f91a7b9f78a660e7ab79aa9fecbc0f (diff)
downloadsparse-dev-e18c1014449adf42520daa9d3e53f78a3d98da34.tar.gz
Make cgcc not pass -Wall to sparse even if passing it to cc
-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". Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'cgcc')
-rwxr-xr-xcgcc15
1 files changed, 14 insertions, 1 deletions
diff --git a/cgcc b/cgcc
index e7d79cf8..6eef9692 100755
--- a/cgcc
+++ b/cgcc
@@ -39,7 +39,7 @@ foreach (@ARGV) {
my $this_arg = ' ' . &quote_arg ($_);
$cc .= $this_arg unless &check_only_option ($_);
- $check .= $this_arg;
+ $check .= $this_arg unless &cc_only_option ($_);
}
if ($do_check) {
@@ -69,6 +69,19 @@ sub check_only_option {
}
# -----------------------------------------------------------------------------
+# 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 {