[Issue 10497] New: Opaque structs cannot be dereferenced in pointer to pointer types
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jun 28 11:06:53 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10497
Summary: Opaque structs cannot be dereferenced in pointer to
pointer types
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: major
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-06-28 11:06:51 PDT ---
-----
module test;
// opaque type
struct S;
void main()
{
S** s;
void* ptr;
*s = cast(S*)ptr; // pointer assignment, not value assignment
}
-----
$ dmd test.d
> test.d(4): Error: struct test.S unknown size
> test.d(4): Error: struct test.S no size yet for forward reference
> test.d(4): Error: struct test.S unknown size
> test.d(4): Error: struct test.S no size yet for forward reference
The size of the structure does not need to be known since what is being
assigned is a memory address. It is not a value assign of the struct.
--
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