diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-05-07 20:53:54 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:00:36 -0700 |
| commit | cd2bb18c786fb6e107640e44a3c54499576b5eb1 (patch) | |
| tree | 9f94d31ffb324e68d5be69d7d92ba1a3fad7b176 /expression.c | |
| parent | 707f38c31eef9dcea3aebb3eb596c3130ae4adbd (diff) | |
| download | sparse-dev-cd2bb18c786fb6e107640e44a3c54499576b5eb1.tar.gz | |
Don't warn about signedness for hax/octal constants. They are commonly
used for bitfields where we really don't care.
Diffstat (limited to 'expression.c')
| -rw-r--r-- | expression.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/expression.c b/expression.c index e57755a7..6e8cddf7 100644 --- a/expression.c +++ b/expression.c @@ -153,10 +153,13 @@ static void get_int_value(struct expression *expr, const char *str) if (BITS_IN_LONG == BITS_IN_INT) modifiers = MOD_LONG | MOD_UNSIGNED; } - warn(expr->pos, "value is so big it is%s%s%s", - (modifiers & MOD_UNSIGNED) ? " unsigned":"", - (modifiers & MOD_LONG) ? " long":"", - (modifiers & MOD_LONGLONG) ? " long":""); + + /* 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", + (modifiers & MOD_UNSIGNED) ? " unsigned":"", + (modifiers & MOD_LONG) ? " long":"", + (modifiers & MOD_LONGLONG) ? " long":""); } expr->type = EXPR_VALUE; |
