diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-26 11:20:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:01:47 -0700 |
commit | f4baf9f7cfa750fd827a905838c24a751468d19b (patch) | |
tree | cca40be13329a2051324c86cf6684b980e6a8ea2 /expression.c | |
parent | Fix "address_of" type evaluation and clean up the code. (diff) | |
download | sparse-f4baf9f7cfa750fd827a905838c24a751468d19b.tar.gz sparse-f4baf9f7cfa750fd827a905838c24a751468d19b.tar.bz2 sparse-f4baf9f7cfa750fd827a905838c24a751468d19b.zip |
Make "value is so big" warning print the constant.
This makes it a lot easier to see what's up.
Diffstat (limited to 'expression.c')
-rw-r--r-- | expression.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/expression.c b/expression.c index 0fd303e..d02452c 100644 --- a/expression.c +++ b/expression.c @@ -88,8 +88,9 @@ static struct token *string_expression(struct token *token, struct expression *e return next; } -static void get_int_value(struct expression *expr, const char *str) +static void get_int_value(struct expression *expr, struct token *token) { + const char *str = token->integer; unsigned long long value = 0; unsigned int base = 10, digit, bits; unsigned long modifiers, extramod; @@ -157,7 +158,8 @@ static void get_int_value(struct expression *expr, const char *str) /* Hex or octal constants don't complain about missing signedness */ if (base == 10 || extramod != MOD_UNSIGNED) - warn(expr->pos, "value is so big it is%s%s%s", + warn(expr->pos, "constant %s is so big it is%s%s%s", + show_token(token), (modifiers & MOD_UNSIGNED) ? " unsigned":"", (modifiers & MOD_LONG) ? " long":"", (modifiers & MOD_LONGLONG) ? " long":""); @@ -194,7 +196,7 @@ struct token *primary_expression(struct token *token, struct expression **tree) case TOKEN_INTEGER: expr = alloc_expression(token->pos, EXPR_VALUE); - get_int_value(expr, token->integer); + get_int_value(expr, token); token = token->next; break; |