diff options
| author | Al Viro <viro@ftp.linux.org.uk> | 2007-07-09 23:13:06 +0100 |
|---|---|---|
| committer | Josh Triplett <josh@freedesktop.org> | 2007-07-10 08:37:20 -0700 |
| commit | 449a5e3b13e1ba529c63dc80615e79d2dafe539b (patch) | |
| tree | 366d676a54e3234fe4b3a8da3ec0950feace3c39 /compile-i386.c | |
| parent | 5061de9a365cd88307c9162c5a8558d1905b5d70 (diff) | |
| download | sparse-dev-449a5e3b13e1ba529c63dc80615e79d2dafe539b.tar.gz | |
fix handling of address_space in casts and assignments
Turn FORCE_MOD into storage class specifier (that's how it's
actually used and that makes for much simpler logics).
Introduce explicit EXPR_FORCE_CAST for forced casts; handle it
properly.
Kill the idiocy in get_as() (we end up picking the oddest things
for address space - e.g. if we have int __attribute__((address_space(1))) *p,
we'll get warnings about removal of address space when we do things like
(unsigned short)*p. Fixed. BTW, that had caught a bunch of very odd
bogosities in the kernel and eliminated several false positives in there.
As the result, get_as() is gone now and evaluate_cast() got simpler.
Kill the similar idiocy in handling pointer assignments; while we are at it,
fix the qualifiers check for assignments to/from void * (you can't assign
const int * to void * - qualifiers on the left side should be no less than
on the right one; for normal codepath we get that checked, but the special
case of void * skips these checks).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'compile-i386.c')
| -rw-r--r-- | compile-i386.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compile-i386.c b/compile-i386.c index 425a1bc7..8526408d 100644 --- a/compile-i386.c +++ b/compile-i386.c @@ -2351,6 +2351,7 @@ static struct storage *x86_expression(struct expression *expr) warning(expr->pos, "invalid expression after evaluation"); return NULL; case EXPR_CAST: + case EXPR_FORCE_CAST: case EXPR_IMPLIED_CAST: return emit_cast_expr(expr); case EXPR_VALUE: |
