(C++) Where does offsetof come from?
- To: redhat-devel-list@xxxxxxxxxx
- Subject: (C++) Where does offsetof come from?
- From: exits funnel <exitsfunnel@xxxxxxxxx>
- Date: Sun, 9 Jan 2005 16:55:58 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=xSp8Fyt5aoDSanxGgGuljTbEXskKGg154qhmc0KXxpe2PK21HI1bNC+OpGNTR9MBKg1xrOtwVBllGTlkmAM5qvMDt3CNOJ3F76aCbzQUMsQv6W6eiPLlnJWr9o6fSTiOj9Pv4uRE2TSgNJGwf8mD4VnSaTcWTrXh1d7FrubL7Xs= ;
- Reply-to: "Red Hat developer's list" <redhat-devel-list@xxxxxxxxxx>
Hello,
I'm trying to figure out where the offsetof macro is
defined? The following code:
// Begin code
#include <iostream.h>
#ifdef offsetof
#define foo 13
#else
#define foo 14
#endif
int main( )
{ cout << "foo = " << foo << endl; }
// End code
prints 13 so it would seem that there is an offsetof
macro defined somewhere. The only one I can find is
in /usr/include/linux/stddef.h but (A) according to
the output of g++ -v, this directory isn't in my
include path and (B) even if it were, I'm not
#including the file. Additionally, if I call offsetof
and run g++ -E it seems as though no substitution has
taken place. I would suspect that the offsetof
support is built right into the compiler but if that
were the case, shouldn't the code above print 14? I'm
using g++ version 3.2.3. If anyone could shed some
light upon where sizeof if defined I'd really
appreciate it.
-exits
__________________________________
Do you Yahoo!?
All your favorites on one personal page ? Try My Yahoo!
http://my.yahoo.com
_______________________________________________
Redhat-devel-list mailing list
Redhat-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/redhat-devel-list
[Home]
[Kernel Newbies]
[Red Hat General]
[Fedora]
[Red Hat Install]
[Kernel List]
[Yosemite News]