Project

General

Profile

« Previous | Next » 

Revision 5471bf9c

Added by shyouhei (Shyouhei Urabe) over 7 years ago

offsetof(type, foo.bar) is (arguably) a GCCism

TL;DR see http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2031.htm

Suppose we have:

struct X {
struct Y {
z_t z;
} y;
} x;

then, you cant infer offsetof(struct X, y.z). The ISO C99 section
7.17 says nothing about such situation. At least clang warns this
being an extension to the language (-Wextended-offsetof).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e