how to compute offset of data member at compile time (virtual class)

John Gateley gateley@jriver.com
Thu Oct 25 21:05:00 GMT 2007


On Fri, 26 Oct 2007 04:59:20 +1000
skaller <skaller@users.sourceforge.net> wrote:

> I use offsetof() on constructible types with virtual functions
> extensively in Felix to calculate the offsets of every pointer
> in every heap allocated data type. Thankfully gcc has a switch
> now which allows this, -Wno-invalid-offsetof, because it is the 
> only way to get the information required, and the 
> information is mandatory for my garbage collector. It works fine
> on MSVC++ too.

THANK YOU! I'd missed the -Wno-invalid-offsetof switch, that
did the trick.

j

-- 
John Gateley <gateley@jriver.com>



More information about the Gcc-help mailing list