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 /expression.h
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 'expression.h')
-rw-r--r--expression.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/expression.h b/expression.h
index 02eec02..fa5039a 100644
--- a/expression.h
+++ b/expression.h
@@ -27,6 +27,7 @@ enum expression_type {
EXPR_PREOP,
EXPR_POSTOP,
EXPR_CAST,
+ EXPR_FORCE_CAST,
EXPR_IMPLIED_CAST,
EXPR_SIZEOF,
EXPR_ALIGNOF,
@@ -190,7 +191,7 @@ static inline struct expression *alloc_const_expression(struct position pos, int
}
/* Type name parsing */
-struct token *typename(struct token *, struct symbol **);
+struct token *typename(struct token *, struct symbol **, int);
static inline int lookup_type(struct token *token)
{