This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


"Shaun Pinney" <shaun.pinney@hl.konicaminolta.us> 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]