3392 – a cast of this to void in tango.core.Thread is not allowed

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3392 - a cast of this to void in tango.core.Thread is not allowed
Summary: a cast of this to void in tango.core.Thread is not allowed
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 critical
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
Reported: 2009年10月13日 04:40 UTC by Fawzi Mohamed
Modified: 2014年04月18日 09:12 UTC (History)
4 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Fawzi Mohamed 2009年10月13日 04:40:50 UTC
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.
Comment 1 Matti Niemenmaa 2009年10月13日 05:35:44 UTC
Reduced testcase:
class Foo {
	Foo next;
	void start()
	in {
		assert (!next);
	} body { 
		void* p = cast(void*)this;
	}
}
Comment 2 Walter Bright 2009年10月13日 19:59:34 UTC
A patch to dmd is in svn now.
Comment 3 Fawzi Mohamed 2009年10月14日 01:49:24 UTC
thanks!
Comment 4 Moritz Warning 2009年10月14日 06:39:49 UTC
Works with r208. Thanks!
Comment 5 Don 2009年10月21日 06:39:49 UTC
Fixed DMD1.050 and DMD2.035.


AltStyle によって変換されたページ (->オリジナル) /