[Issue 6089] __gshared with not static 2D array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 18 08:00:04 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=6089


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-03-18 08:00:02 PDT ---
(In reply to comment #0)
> With DMD 2.053 this program:
> 
> 
> void main() {
>     __gshared int[1][1] foo;
> }

This is fixed by Issue 8041.

(In reply to comment #1)
> Similarly, this should be valid code.
> 
> void main()
> {
>    __thread int[1][1] foo;
> }

__thread has since been removed.

> and this shouldn't try to assign a default initializer at all!
> 
> void main()
> {
>    extern int[1][1] foo;
> }

What exactly are the semantics of this? It has D mangling, so where can you
define (not declare) foo? I guess you could use mangling hacks such as:

extern(C) int[1][1] D4test4mainFZv3fooG1G1i = [[4]];

void main()
{
    extern int[1][1] foo;
    assert(foo == [[4]]);
}

Is this ok though?

Note that declaring `extern(C) int[1][1] foo;` does already work.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list