aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/parse.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2016-11-02 22:59:37 +0100
committerChristopher Li <sparse@chrisli.org>2017-02-13 09:34:43 +0800
commitf25e41f4856b800d41a5d97122ed881a261deb50 (patch)
tree246403666ed1d4270ecd74122d512616aec5b9c7 /parse.c
parentd589636c2475bf049b518a55e1b0d8519335936d (diff)
downloadsparse-dev-f25e41f4856b800d41a5d97122ed881a261deb50.tar.gz
Warn on unknown attributes instead of throwing errors
GCC creates new attributes quite often, generaly for specific usages irrelevant to what sparse is used for. Throwing errors on these create needless noise and annoyance which is better to avoid. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 13b8d341..d45c0af4 100644
--- a/parse.c
+++ b/parse.c
@@ -1230,7 +1230,8 @@ static struct token *recover_unknown_attribute(struct token *token)
{
struct expression *expr = NULL;
- sparse_error(token->pos, "attribute '%s': unknown attribute", show_ident(token->ident));
+ if (Wunknown_attribute)
+ warning(token->pos, "attribute '%s': unknown attribute", show_ident(token->ident));
token = token->next;
if (match_op(token, '('))
token = parens_expression(token, &expr, "in attribute");