www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3392] New: a cast of this to void in tango.core.Thread is not allowed

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3392

           Summary: a cast of this to void in tango.core.Thread is not
                    allowed
           Product: D
           Version: 1.048
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: fawzi gmx.ch


--- Comment #0 from Fawzi Mohamed <fawzi gmx.ch> 2009-10-13 04:40:50 PDT ---
Tango does not compile (just ./build/build.sh ), but stops with an error

{{{
.../Thread.d(659): Error: e2ir: cannot cast from tango.core.Thread.Thread to
void*
}}}

this is just a cast of this to void*, even rewriting the lines like this
{{{
                void *arg=cast(void*)cast(Object)this;
                if( pthread_create( &m_addr, &attr, &thread_entryPoint, arg )
!= 0 )
}}}

gives an error casting this.

Unfortunately just about any reduced example work...

both 1.048 and 1.049 have this issue, it is a blocker for tango.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 13 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3392


Matti Niemenmaa <matti.niemenmaa+dbugzilla iki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matti.niemenmaa+dbugzilla i
                   |                            |ki.fi
           Platform|Other                       |All
         OS/Version|Mac OS X                    |All


--- Comment #1 from Matti Niemenmaa <matti.niemenmaa+dbugzilla iki.fi>
2009-10-13 05:35:44 PDT ---
Reduced testcase:

class Foo {
    Foo next;
    void start()
    in {
        assert (!next);
    } body { 
        void* p = cast(void*)this;
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 13 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3392


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com


--- Comment #2 from Walter Bright <bugzilla digitalmars.com> 2009-10-13
19:59:34 PDT ---
A patch to dmd is in svn now.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 13 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3392



--- Comment #3 from Fawzi Mohamed <fawzi gmx.ch> 2009-10-14 01:49:24 PDT ---
thanks!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3392


Moritz Warning <moritzwarning web.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |moritzwarning web.de


--- Comment #4 from Moritz Warning <moritzwarning web.de> 2009-10-14 06:39:49
PDT ---
Works with r208. Thanks!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3392


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |FIXED


--- Comment #5 from Don <clugdbug yahoo.com.au> 2009-10-21 06:39:49 PDT ---
Fixed DMD1.050 and DMD2.035.

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