diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-12-09 21:17:55 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-12-12 18:48:52 +0100 |
commit | 54c243b16fdf43e4cc4bef6aad3e50bc0c32547c (patch) | |
tree | 63ad0a071dc6c0e923e76dcb4177f78a647879f1 | |
parent | 2da3f3cdd4b6817553b7290806cd7f84476d8fb6 (diff) | |
download | sparse-54c243b16fdf43e4cc4bef6aad3e50bc0c32547c.tar.gz |
as-name: check for multiple address spaces at parsing time
Warn on non-sensical declarations like:
int __user __iomem *ptr;
These can be easily be checked at parsing time.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | parse.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1129,8 +1129,13 @@ static struct token *attribute_address_space(struct token *token, struct symbol warning(token->pos, "invalid address space name"); } - if (Waddress_space && as) + if (Waddress_space && as) { + if (ctx->ctype.as) + sparse_error(token->pos, + "multiple address space given: %s & %s", + show_as(ctx->ctype.as), show_as(as)); ctx->ctype.as = as; + } token = expect(next, ')', "after address_space attribute"); return token; } |