[Issue 1875] Dereferencing void pointers is allowed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 27 23:28:51 PST 2008


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





------- Comment #4 from braddr at puremagic.com  2008-02-28 01:28 -------
Um.. at no point in this code has anything been dereferenced.  The only thing
occurring here is pointer math (against 0, but still just math).  Further, it
actually _is_ legal in both c and c++.  In fact, the offsetof macro is built
around that capability:

#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)


-- 



More information about the Digitalmars-d-bugs mailing list