aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2003-06-10 17:03:25 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:52 -0700
commit42ebe65d4fbf4e99f1c3525d06b3244310f20f62 (patch)
treeffedf10012ac1c2c4a2062bd2908163ab82d7bbe
parent33d6edbdc44d3cc088f59f6fd2440fd601d56e84 (diff)
downloadsparse-42ebe65d4fbf4e99f1c3525d06b3244310f20f62.tar.gz
sparse-42ebe65d4fbf4e99f1c3525d06b3244310f20f62.tar.xz
sparse-42ebe65d4fbf4e99f1c3525d06b3244310f20f62.zip
Add "-v" flag for verbose mode.
Warn about internal "not implemented yet" kinds of things only when verbose. These warnings have nothing to do with the sources we're checking, they're only good for pointing out limitations of sparse itself.
-rw-r--r--check.c4
-rw-r--r--inline.c3
-rw-r--r--pre-process.c1
-rw-r--r--token.h2
4 files changed, 7 insertions, 3 deletions
diff --git a/check.c b/check.c
index 0622889..aae7b78 100644
--- a/check.c
+++ b/check.c
@@ -66,7 +66,9 @@ static char ** handle_switch(char *arg, char **next)
case 'E':
preprocess_only = 1;
return next;
-
+ case 'v':
+ verbose = 1;
+ return next;
case 'I':
add_pre_buffer("#add_include \"%s/\"\n", arg+1);
return next;
diff --git a/inline.c b/inline.c
index 958a3f1..b0725ba 100644
--- a/inline.c
+++ b/inline.c
@@ -109,7 +109,8 @@ static struct expression * copy_expression(struct expression *expr)
}
default:
- warn(expr->pos, "trying to copy expression type %d", expr->type);
+ if (verbose)
+ warn(expr->pos, "trying to copy expression type %d", expr->type);
}
return expr;
}
diff --git a/pre-process.c b/pre-process.c
index 5bbe32c..c39d996 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -25,6 +25,7 @@
#include "symbol.h"
#include "expression.h"
+int verbose = 0;
int preprocessing = 0;
#define MAXNEST (16)
diff --git a/token.h b/token.h
index e192597..6c7171d 100644
--- a/token.h
+++ b/token.h
@@ -137,7 +137,7 @@ struct token {
* This allows us to not test for NULL pointers
* when following the token->next chain..
*/
-extern int preprocessing;
+extern int preprocessing, verbose;
extern struct token eof_token_entry;
#define eof_token(x) ((x) == &eof_token_entry)