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

Ian Lance Taylor iant@google.com
Sat Mar 26 01:32:00 GMT 2011


"Shaun Pinney" <shaun.pinney@hl.konicaminolta.us> writes:

> Thanks Ian.  I thought this would be the case.  I'm thinking, since there is
> a runtime component to __thread, there may be a function to query if a
> variable is thread-local (e.g. __isthreadscope(), __getscope(), etc).  Do
> you know of any query method?  It's not a major issue, but would help a bit.
> So far, I haven't spotted one.  Thanks again.

Any such test would have to be a compiler intrinsic, of course--once you
call a function the information has been lost.  As far as I know there
is no such intrinsic.

Ian



More information about the Gcc-help mailing list