Re: How to give compiler error if a function parameter is not declared with __thread?

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

 



"Shaun Pinney" <shaun.pinney@xxxxxxxxxxxxxxxxxxx> writes:

> I want to restrict a function parameter to variables declared with __thread.
> Is there a way to generate compiler errors if a user uses an incompatible
> storage class?  The idea is to improve the 'user-friendliness' of an OS
> porting layer - specifically, the parts related to thread-local storage.

__thread is of course a concept that only applies to global or static
variables, not to function parameters; function parameters are always
thread-local.  There is no way to require that all arguments in a
function call be __thread global/static variables, no.

Ian


[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