All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Christopher Li <sparse@chrisli.org>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 1/3] Warn on unknown attributes instead of throwing errors
Date: Wed,  2 Nov 2016 22:59:37 +0100	[thread overview]
Message-ID: <20161102215939.36765-2-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20161102215939.36765-1-luc.vanoostenryck@gmail.com>

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>
---
 parse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/parse.c b/parse.c
index 205e1264..212fae3a 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");
-- 
2.10.1


  reply	other threads:[~2016-11-02 22:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 21:59 [PATCH 0/3] reduce noise from unknown attributes Luc Van Oostenryck
2016-11-02 21:59 ` Luc Van Oostenryck [this message]
2016-11-02 22:29   ` [PATCH 1/3] Warn on unknown attributes instead of throwing errors Ramsay Jones
2016-11-02 23:09     ` Luc Van Oostenryck
2016-11-02 21:59 ` [PATCH 2/3] Add a new warning flag: '-Wunknown-attribute' Luc Van Oostenryck
2016-11-02 21:59 ` [PATCH 3/3] By default disable '-Wunknown-attribute' Luc Van Oostenryck
2016-11-17 16:52   ` Christopher Li
2016-11-17 18:04     ` Luc Van Oostenryck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161102215939.36765-2-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.