LWN.net Logo

wrong about offsetof()

wrong about offsetof()

Posted Mar 28, 2006 5:23 UTC (Tue) by JoeBuck (subscriber, #2330)
In reply to: Building the whole Debian archive with GCC 4.1: a summary by butlerm
Parent article: Building the whole Debian archive with GCC 4.1: a summary

ISO C++, and GCC, allow offsetof() for C-style structs (PODs - plain old data types). It does not allow offsetof() for arbitrary C++ classes.


(Log in to post comments)

wrong about offsetof()

Posted Mar 28, 2006 8:40 UTC (Tue) by philips (guest, #937) [Link]

Yeah, I had some fun with that too.

People love to use inheritence with structures and then claim that it's perfectly Okay C (since no classes) code...

wrong about offsetof()

Posted Mar 29, 2006 5:25 UTC (Wed) by butlerm (subscriber, #13312) [Link]

Sorry - I meant C++ classes in general, not PODs.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds