Problem with coupling shared object symbol visibility with protection

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 31 14:42:06 PST 2015


On Wednesday, 28 January 2015 at 13:48:45 UTC, Dicebot wrote:
> Isn't that what your first proposed solution is about? That was 
> my understanding and I liked that understanding :) To be 100% 
> clear :
>
> export void foo(T : int)(T x)
> {
>     bar(x);
> }
>
> private void bar(int x) { }
>
> I'd expect `bar` to be exported into resulting binary so that 
> it can be linked against by any users of `foo` but for any 
> attempt to call `bar` directly from D code to fail because of 
> protection violation. If someone wants to circumvent protection 
> by forging mangling - shooting own feet is allowed.

So you'd want bar to be duplicated on both sides ? This is gonna 
cause problems with di files.


More information about the Digitalmars-d mailing list