Re: Internal linkage - equivalent of C++ global static and anonymous namespaces

2014-06-13 Thread deadalnix via Digitalmars-d
On Thursday, 12 June 2014 at 14:48:41 UTC, Dicebot wrote: On Thursday, 12 June 2014 at 14:23:59 UTC, Jacob Carlborg wrote: On 12/06/14 11:48, Kagamin wrote: Why private members can't have internal linkage? It's currently possible to access private symbols through pointers. And aliases

Re: Internal linkage - equivalent of C++ global static and anonymous namespaces

2014-06-13 Thread deadalnix via Digitalmars-d
On Thursday, 12 June 2014 at 14:23:59 UTC, Jacob Carlborg wrote: On 12/06/14 11:48, Kagamin wrote: Why private members can't have internal linkage? It's currently possible to access private symbols through pointers. You don't need a symbol in the object file for that.

Internal linkage - equivalent of C++ global static and anonymous namespaces

2014-06-12 Thread Francesco Cattoglio via Digitalmars-d
Yesterday I discovered that a global static variable in D is just a global variable, with no special rule about symbol visibility and such. I've scrolled quickly through old discussions on the NG and read the relevant DIP: http://wiki.dlang.org/DIP22 It seems to me that nobody thought about

Re: Internal linkage - equivalent of C++ global static and anonymous namespaces

2014-06-12 Thread Kagamin via Digitalmars-d
Why private members can't have internal linkage?

Re: Internal linkage - equivalent of C++ global static and anonymous namespaces

2014-06-12 Thread Francesco Cattoglio via Digitalmars-d
On Thursday, 12 June 2014 at 09:48:30 UTC, Kagamin wrote: Why private members can't have internal linkage? There has been some discussion about a few corner cases, see http://forum.dlang.org/thread/jlbsreudrapysiaet...@forum.dlang.org?page=2#post-irrbdrxordjawkryvrub:40forum.dlang.org and

Re: Internal linkage - equivalent of C++ global static and anonymous namespaces

2014-06-12 Thread Dicebot via Digitalmars-d
On Thursday, 12 June 2014 at 09:48:30 UTC, Kagamin wrote: Why private members can't have internal linkage? tl; dr: because private provides zero guarantees that symbol won't be referenced in ABI context. It only controls direct language level access. It can possibly be done with analysis

Re: Internal linkage - equivalent of C++ global static and anonymous namespaces

2014-06-12 Thread Jacob Carlborg via Digitalmars-d
On 12/06/14 11:48, Kagamin wrote: Why private members can't have internal linkage? It's currently possible to access private symbols through pointers. -- /Jacob Carlborg

Re: Internal linkage - equivalent of C++ global static and anonymous namespaces

2014-06-12 Thread Dicebot via Digitalmars-d
On Thursday, 12 June 2014 at 14:23:59 UTC, Jacob Carlborg wrote: On 12/06/14 11:48, Kagamin wrote: Why private members can't have internal linkage? It's currently possible to access private symbols through pointers. And aliases with different qualifiers. And via return values. And with