aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/parse.c
diff options
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 16:44:54 +0000
committerChristopher Li <sparse@chrisli.org>2009-07-18 05:30:10 +0000
commit7ffff9cb3d04c99107dee6f4283311a9b132d67b (patch)
tree41ace6673219954822739ae60632faf97cb66796 /parse.c
parent8d86d0e51b64a5292d246e2ff6b18951e120d580 (diff)
downloadsparse-dev-7ffff9cb3d04c99107dee6f4283311a9b132d67b.tar.gz
Allow array declarators to have 'restrict' in them
Otherwise sparse is very unhappy about the current glibc header files (aio.h, netdb.h. regex.h and spawn.h at a minimum). It's a hack, and not a proper parsing with saving the information. It just ignores any "restrict" keyword at the start of an abstract array declaration, but it's better than what we have now. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index fbeebb0a..df696e56 100644
--- a/parse.c
+++ b/parse.c
@@ -1431,6 +1431,8 @@ static struct token *abstract_array_declarator(struct token *token, struct symbo
{
struct expression *expr = NULL;
+ if (match_idents(token, &restrict_ident, &__restrict_ident, NULL))
+ token = token->next;
token = parse_expression(token, &expr);
sym->array_size = expr;
return token;