[Bug c++/27724] [4.1/4.2 Regression] internal compiler error: no-op convert from 4 to 8 bytes in initializer

bero at arklinux dot org gcc-bugzilla@gcc.gnu.org
Tue May 23 21:41:00 GMT 2006



------- Comment #6 from bero at arklinux dot org  2006-05-23 21:41 -------
It is creative offsetof indeed -- this a "explanation" from a bit of code
referenced to this one [while it isn't free yet, its license does allow posting
bits of it online]:



// HACK: gcc warns about applying offsetof() to non-POD object or calculating
//       offset directly when base address is NULL. Use 16 to get around the
//       warning. gcc-3.4 has an option -Wno-invalid-offsetof to suppress
//       this warning.
#define offset_of(klass,field) (size_t)((intx)&(((klas*)16)->field) - 16)



Looks like someone was desperate to get his stuff to compile with -Werror
without having to fix the cause.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27724



More information about the Gcc-bugs mailing list