linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Christopher Li <sparse@chrisli.org>
Cc: Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: [PATCH 02/10] sparse: add 'gnu_inline' to the ignored attributes
Date: Mon, 04 Aug 2014 19:33:42 +0100	[thread overview]
Message-ID: <53DFD206.20002@ramsay1.demon.co.uk> (raw)


Add some more ignored attributes which are used in glibc header files,
along with a simple test case which includes all three inline attributes
(__gnu_inline__, __always_inline__ and __noinline__).

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 parse.c                  |  2 ++
 validation/attr-inline.c | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100644 validation/attr-inline.c

diff --git a/parse.c b/parse.c
index 9767e59..69bcf82 100644
--- a/parse.c
+++ b/parse.c
@@ -536,6 +536,8 @@ const char *ignored_attributes[] = {
 	"__format__",
 	"format_arg",
 	"__format_arg__",
+	"gnu_inline",
+	"__gnu_inline__",
 	"hot",
 	"__hot__",
         "leaf",
diff --git a/validation/attr-inline.c b/validation/attr-inline.c
new file mode 100644
index 0000000..1b88ddb
--- /dev/null
+++ b/validation/attr-inline.c
@@ -0,0 +1,21 @@
+
+static inline __attribute__((__always_inline__)) int gt(int lhs, int rhs)
+{
+	return lhs > rhs;
+}
+
+extern inline __attribute__((__gnu_inline__)) int ge(int lhs, int rhs)
+{
+	return lhs >= rhs;
+}
+
+static __attribute__((__warning__("That's junk!"))) __attribute__((__unused__))
+__attribute__((__noinline__))
+void junk(void)
+{
+	__asm__("");
+}
+
+/*
+ * check-name: inline attributes
+ */
-- 
2.0.0

             reply	other threads:[~2014-08-04 18:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 18:33 Ramsay Jones [this message]
2014-08-07 18:25 ` [PATCH 02/10] sparse: add 'gnu_inline' to the ignored attributes Christopher Li

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=53DFD206.20002@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1.demon.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).