* [PATCH 02/10] sparse: add 'gnu_inline' to the ignored attributes
@ 2014-08-04 18:33 Ramsay Jones
2014-08-07 18:25 ` Christopher Li
0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2014-08-04 18:33 UTC (permalink / raw)
To: Christopher Li; +Cc: Sparse Mailing-list
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 02/10] sparse: add 'gnu_inline' to the ignored attributes
2014-08-04 18:33 [PATCH 02/10] sparse: add 'gnu_inline' to the ignored attributes Ramsay Jones
@ 2014-08-07 18:25 ` Christopher Li
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Li @ 2014-08-07 18:25 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Sparse Mailing-list
On Mon, Aug 4, 2014 at 11:33 AM, Ramsay Jones
<ramsay@ramsay1.demon.co.uk> wrote:
>
> 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__).
This change looks good.
Chris
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-07 18:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-04 18:33 [PATCH 02/10] sparse: add 'gnu_inline' to the ignored attributes Ramsay Jones
2014-08-07 18:25 ` Christopher Li
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).