__thread storage specifier documentation

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

 



Hi,

this is just a minor clarification about the documentation on __thread gcc keyword.

According to

http://gcc.gnu.org/onlinedocs/gcc/Thread_002dLocal.html#Thread_002dLocal

"The __thread specifier may be used alone, with the extern or static specifiers, but with no other storage class specifier. When used with extern or static, __thread must appear _immediately_ after the other storage class specifier."

I wonder if this _immediately_ means that the __thread keyword must appear next to the "extern" or "static" (if any) or the programmer can intersperse other declaration specifiers between them, but keeping the order between storage specifiers.

I mean,

void f()
{
/* This is strictly immediately "static __thread", gcc accepts this */
  static __thread int a;

/* This is not strictly immediately, there is type-specifier 'int' between 'static' and '__thread' and gcc accepts this */
  static int __thread b;
}

Thank you !

--
Roger Ferrer Ibáñez - roger.ferrer@xxxxxx

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux