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

Shaun Pinney shaun.pinney@hl.konicaminolta.us
Sat Mar 26 01:38:00 GMT 2011


Thanks very much for checking.  I can put adequate notes in the
documentation to address this.  Let's hope people read them :)

Best regards,
Shaun

> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
> Behalf Of Ian Lance Taylor
> Sent: Friday, March 25, 2011 6:33 PM
> To: Shaun Pinney
> Cc: gcc-help@gcc.gnu.org
> Subject: Re: How to give compiler error if a function parameter is not
> declared with __thread?
> 
> "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