aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2003-05-07 20:53:54 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:36 -0700
commitcd2bb18c786fb6e107640e44a3c54499576b5eb1 (patch)
tree9f94d31ffb324e68d5be69d7d92ba1a3fad7b176 /expression.c
parentMake "check" a bit nicer about checking kernel files: (diff)
downloadsparse-cd2bb18c786fb6e107640e44a3c54499576b5eb1.tar.gz
sparse-cd2bb18c786fb6e107640e44a3c54499576b5eb1.tar.bz2
sparse-cd2bb18c786fb6e107640e44a3c54499576b5eb1.zip
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.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/expression.c b/expression.c
index e57755a..6e8cddf 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;