[PATCH 1/5] C11: teach sparse about '_Thread_local'

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

 



This is simply a new name for GCC's '__thread' which was already
supported.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 parse.c                       | 1 +
 validation/c11-thread-local.c | 9 +++++++++
 2 files changed, 10 insertions(+)
 create mode 100644 validation/c11-thread-local.c

diff --git a/parse.c b/parse.c
index b52c6abe..7fc145db 100644
--- a/parse.c
+++ b/parse.c
@@ -443,6 +443,7 @@ static struct init_keyword {
 	{ "static",	NS_TYPEDEF, .op = &static_op },
 	{ "extern",	NS_TYPEDEF, .op = &extern_op },
 	{ "__thread",	NS_TYPEDEF, .op = &thread_op },
+	{ "_Thread_local",	NS_TYPEDEF, .op = &thread_op },
 
 	/* Statement */
 	{ "if",		NS_KEYWORD, .op = &if_op },
diff --git a/validation/c11-thread-local.c b/validation/c11-thread-local.c
new file mode 100644
index 00000000..464c3e16
--- /dev/null
+++ b/validation/c11-thread-local.c
@@ -0,0 +1,9 @@
+static _Thread_local int foo;
+
+/*
+ * check-name: c11-thread-local
+ * check-command: test-parsing -std=c11 $file
+ *
+ * check-output-ignore
+ * check-output-contains: \[tls\]
+ */
-- 
2.11.0

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