This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/13275] [3.4 regression] Implementation of offsetof macro


------- Additional Comments From nathan at gcc dot gnu dot org  2003-12-03 08:58 -------
I have come to the conclusion that one *cannot* implement offsetof without
a builtin of some kind. You need something like
#define offsetof(type,member) \
   __builtin_offsetof (__builtin_offset_obj(type).member)
You need cooperation from the parser, so that the .MEMBER part is
looked up in the context of TYPE - hence the __builtin_offset_obj part.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]