diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-01-05 04:22:16 +0100 |
|---|---|---|
| committer | Christopher Li <sparse@chrisli.org> | 2017-02-13 09:34:45 +0800 |
| commit | 2a67f7fb593572c8c58a58e8e8d69f73ba65387f (patch) | |
| tree | cfc7a281e33d6b932f8d1e641407fbf6b9d68254 | |
| parent | c0ad591813d823176e71e18704461e9e7f8e9af5 (diff) | |
| download | sparse-dev-2a67f7fb593572c8c58a58e8e8d69f73ba65387f.tar.gz | |
C11: teach sparse about '_Thread_local'
This is simply a new name for GCC's '__thread' which was already
supported.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
| -rw-r--r-- | parse.c | 1 | ||||
| -rw-r--r-- | validation/c11-thread-local.c | 9 |
2 files changed, 10 insertions, 0 deletions
@@ -451,6 +451,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\] + */ |
