aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/expression.c
diff options
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-29 11:05:34 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:02:08 -0700
commit29ec7fb14dfd2369194b327402ac8a812dcb6b06 (patch)
treecab83db9778834810dde5f9e8cd5b8a9e5441e15 /expression.c
parentcf87096e8b6f5f6a27efe209bf99eeec35f5d063 (diff)
downloadsparse-dev-29ec7fb14dfd2369194b327402ac8a812dcb6b06.tar.gz
If int/long are the same size, an int that overflows into
unsigned stays as an (unsigned) int. Otherwise it becomes a long.
Diffstat (limited to 'expression.c')
-rw-r--r--expression.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/expression.c b/expression.c
index 27b72e63..ea32a14b 100644
--- a/expression.c
+++ b/expression.c
@@ -175,9 +175,8 @@ static void get_number_value(struct expression *expr, struct token *token)
*/
modifiers |= extramod;
if (base == 10 && modifiers == MOD_UNSIGNED) {
- modifiers = MOD_LONG;
- if (bits_in_long == bits_in_int)
- modifiers = MOD_LONG | MOD_UNSIGNED;
+ if (bits_in_long != bits_in_int)
+ modifiers = MOD_LONG;
}
/* Hex or octal constants don't complain about missing signedness */