diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2004-07-15 21:13:55 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:02:12 -0700 |
commit | a1ec3c79c0f648d2f96531e068325233c54f101f (patch) | |
tree | abca06ec3ce149d73695f851159c849db9b08f3f /compile-i386.c | |
parent | The base type of an enum is "int". (diff) | |
download | sparse-a1ec3c79c0f648d2f96531e068325233c54f101f.tar.gz sparse-a1ec3c79c0f648d2f96531e068325233c54f101f.tar.bz2 sparse-a1ec3c79c0f648d2f96531e068325233c54f101f.zip |
[PATCH] teach sparse about __alignof__
This teaches sparse what __alignof__ really means, instead of just using
the same code as "__sizeof__"
It gets rid of the warnings in ebtables that does:
struct ebt_entries {
...
char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)));
};
Which caused warning because sparse was evaluating __alignof__ as the same as sizeof,
and sizeof was 57 (ie non-power of 2).
This is just based on the existing code and a peek at the data
structures in expression and symbol.
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 70253b7..2c9bef7 100644 --- a/compile-i386.c +++ b/compile-i386.c @@ -2121,6 +2121,7 @@ static struct storage *x86_expression(struct expression *expr) return emit_symbol_expr_init(expr->symbol); case EXPR_DEREF: case EXPR_SIZEOF: + case EXPR_ALIGNOF: warn(expr->pos, "invalid expression after evaluation"); return NULL; case EXPR_CAST: |