linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sparse: add no_sanitize_address as an ignored attribute
@ 2016-06-01  2:45 Rui Teng
  0 siblings, 0 replies; only message in thread
From: Rui Teng @ 2016-06-01  2:45 UTC (permalink / raw)
  To: sparse; +Cc: linux-sparse, Rui Teng

Add attribute "no_sanitize_address" or "__no_sanitize_address__" as an ignored
attribute. Fixes this sparse warning:

include/linux/compiler.h:232:8: error: attribute 'no_sanitize_address': unknown attribute

Also add test case for 'no_sanitize_address': validation/attr-no_sanitize_address.c.
'make check' says for this test case:
    TEST     attribute no_sanitize_address (attr-no_sanitize_address.c)

Signed-off-by: Rui Teng <rui.teng@linux.vnet.ibm.com>
---
 parse.c                               | 2 ++
 validation/attr-no_sanitize_address.c | 9 +++++++++
 2 files changed, 11 insertions(+)
 create mode 100644 validation/attr-no_sanitize_address.c

diff --git a/parse.c b/parse.c
index b43d683..5a90b4d 100644
--- a/parse.c
+++ b/parse.c
@@ -601,6 +601,8 @@ const char *ignored_attributes[] = {
 	"__warning__",
 	"weak",
 	"__weak__",
+	"no_sanitize_address",
+	"__no_sanitize_address__",
 };
 
 
diff --git a/validation/attr-no_sanitize_address.c b/validation/attr-no_sanitize_address.c
new file mode 100644
index 0000000..b57ee55
--- /dev/null
+++ b/validation/attr-no_sanitize_address.c
@@ -0,0 +1,9 @@
+#define __no_sanitize_address __attribute__((no_sanitize_address))
+
+static void __no_sanitize_address bar(void)
+{
+}
+
+/*
+ * check-name: attribute no_sanitize_address
+ */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-01  2:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-01  2:45 [PATCH] sparse: add no_sanitize_address as an ignored attribute Rui Teng

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).