From: <no...@so...> - 2001-09-11 11:30:26
|
Bugs item #460662, was opened at 2001-09-11 04:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=100599&aid=460662&group_id=599 Category: C-Front End Group: None Status: Open Resolution: None Priority: 5 Submitted By: Bernhard Held (bernhardheld) Assigned to: Nobody/Anonymous (nobody) Summary: offsetof() crashes compiler Initial Comment: struct STR { char c1, c2; }; unsigned foo() { // crash #1 return (unsigned) & (((struct STR *) 0) -> c2); // ok //return (unsigned) & (((struct STR code *) 0) -> c2); } #define offsetof(TYPE, MEMBER) \ ((unsigned) &((TYPE code *)0)->MEMBER) foo2 () { // crash #2, even with "code *" if (0 < offsetof(struct STR, c2)) ; } Bernhard ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=100599&aid=460662&group_id=599 |