digitalmars.D.learn - __gshared static
- =?UTF-8?B?Ik3DoXJjaW8=?= Martins" (11/11) Apr 24 2015 Hi!
- Steven Schveighoffer (4/12) Apr 24 2015 These are the same, __gshared overrides static.
- bearophile (5/6) Apr 24 2015 Isn't forbidding "__gshared static" a good idea then, to avoid
- Steven Schveighoffer (10/14) Apr 24 2015 Surely, prohibiting non-functioning attributes is good when it's obvious...
- =?UTF-8?B?Ik3DoXJjaW8=?= Martins" (3/20) Apr 24 2015 Thanks Steve!
Hi! I just stumbled across what seems like a misunderstanding on my side about these keywords. Can someone help clarify these for me? ``` __gshared static int foo; __gshared int foo; ``` What are the storage and semantic differences between those two, if any? Cheers, -M
Apr 24 2015
On 4/24/15 1:22 PM, "=?UTF-8?B?Ik3DoXJjaW8=?= Martins\" <marcioapm gmail.com>\"" wrote:Hi! I just stumbled across what seems like a misunderstanding on my side about these keywords. Can someone help clarify these for me? ``` __gshared static int foo; __gshared int foo; ``` What are the storage and semantic differences between those two, if any?These are the same, __gshared overrides static. -Steve
Apr 24 2015
Steven Schveighoffer:These are the same, __gshared overrides static.Isn't forbidding "__gshared static" a good idea then, to avoid user confusion? Bye, bearophile
Apr 24 2015
On 4/24/15 2:47 PM, bearophile wrote:Steven Schveighoffer:Surely, prohibiting non-functioning attributes is good when it's obvious that they do nothing. BUT... there is an issue: static: __gshared int x; Should this be an error? I believe inside the compiler, the reason unused attributes are ignored are because this is handled the same way, and making it error would make all of them error. But that's kind of a guess. -SteveThese are the same, __gshared overrides static.Isn't forbidding "__gshared static" a good idea then, to avoid user confusion?
Apr 24 2015
On Friday, 24 April 2015 at 18:05:22 UTC, Steven Schveighoffer wrote:On 4/24/15 1:22 PM, "=?UTF-8?B?Ik3DoXJjaW8=?= Martins\" <marcioapm gmail.com>\"" wrote:Thanks Steve!Hi! I just stumbled across what seems like a misunderstanding on my side about these keywords. Can someone help clarify these for me? ``` __gshared static int foo; __gshared int foo; ``` What are the storage and semantic differences between those two, if any?These are the same, __gshared overrides static. -Steve
Apr 24 2015