aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-07-09 23:13:06 +0100
committerJosh Triplett <josh@freedesktop.org>2007-07-10 08:37:20 -0700
commit449a5e3b13e1ba529c63dc80615e79d2dafe539b (patch)
tree366d676a54e3234fe4b3a8da3ec0950feace3c39 /show-parse.c
parentmake size_t better approximate the reality (diff)
downloadsparse-449a5e3b13e1ba529c63dc80615e79d2dafe539b.tar.gz
sparse-449a5e3b13e1ba529c63dc80615e79d2dafe539b.tar.bz2
sparse-449a5e3b13e1ba529c63dc80615e79d2dafe539b.zip
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 'show-parse.c')
-rw-r--r--show-parse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/show-parse.c b/show-parse.c
index 07ee763..aae8b74 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -1053,6 +1053,7 @@ int show_expression(struct expression *expr)
warning(expr->pos, "invalid expression after evaluation");
return 0;
case EXPR_CAST:
+ case EXPR_FORCE_CAST:
case EXPR_IMPLIED_CAST:
return show_cast_expr(expr);
case EXPR_VALUE: