diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-03-28 21:41:56 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 20:59:53 -0700 |
| commit | 24131a1b9dd4652d55ede6976f354197d7a03232 (patch) | |
| tree | 0668ca3d694731bef0476f501b239c511d81a70e | |
| parent | 2ca23c6cb2f8cb7625e33702593c62fb91524797 (diff) | |
| download | sparse-dev-24131a1b9dd4652d55ede6976f354197d7a03232.tar.gz | |
Fix up the 'value is so large it is XXXX' message in the presense
of partial (but insufficient for the size) type suffixes. Also,
fix the decimal special case in case the user already had 'l' or 'll'
suffixes but needed an extra 'u'.
| -rw-r--r-- | evaluate.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -106,16 +106,16 @@ static int get_int_value(struct expression *expr, const char *str) * Special case: "int" gets promoted directly to "long" * for normal decimal numbers.. */ - if (base == 10 && extramod == MOD_UNSIGNED) { - extramod = MOD_LONG; + modifiers |= extramod; + if (base == 10 && modifiers == MOD_UNSIGNED) { + modifiers = MOD_LONG; if (BITS_IN_LONG == BITS_IN_INT) - extramod = MOD_LONG | MOD_UNSIGNED; + modifiers = MOD_LONG | MOD_UNSIGNED; } warn(expr->token, "value is so big it is%s%s%s", - (extramod & MOD_UNSIGNED) ? " unsigned":"", - (extramod & MOD_LONG) ? " long":"", - (extramod & MOD_LONGLONG) ? " long":""); - modifiers |= extramod; + (modifiers & MOD_UNSIGNED) ? " unsigned":"", + (modifiers & MOD_LONG) ? " long":"", + (modifiers & MOD_LONGLONG) ? " long":""); } expr->type = EXPR_VALUE; |
