__thread上的夹板barf,它是C99的一部分

Mat*_*ner 0 c linux gcc splint thread-local-storage

运行夹板

matt@stanley:~/cpfs$ splint -paramuse +gnuextensions cpfs.c
Run Code Online (Sandbox Code Playgroud)

暂停此行:

__thread int cpfs_errno;
Run Code Online (Sandbox Code Playgroud)

解析错误:

cpfs.c:127:13: Parse Error: Non-function declaration: __thread :
               int. (For help on parse errors, see splint -help parseerrors.)
*** Cannot continue.

检查文档和漱口水没有提到__thread.然而,这__thread是C99规范的一部分,据称Splint支持(插入引用).

这里发生了什么?如何识别夹板__thread

caf*_*caf 6

__thread不在C99.它是GNU C扩展 - 您链接的部分位于C语言系列的扩展中.它描述了C99标准变更方面的扩展,可能是为了在未来的标准修订版中采用它.