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 gdr at integrable-solutions dot net  2003-12-03 09:53 -------
Subject: Re:  [3.4 regression] Implementation of offsetof macro

"nathan at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| 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.

wouldn't __offsetof__(type, member_name) suffice? The first argument
would provide the type (for the context).  That is, I would like to
understand why we need the xxx_obj built-in.

-- Gaby


-- 


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]