[PATCH] sparse: add no_sanitize_address as an ignored attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux