Re: defining big types on avr-gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Massimiliano Cialdi <massimiliano.cialdi@xxxxxxxxxxxx> writes:

> Il giorno mer, 04/08/2010 alle 10.35 +0100, Andrew Haley ha scritto:
>> > I never read or write data poined by p. I only use it to calculate
>> > offset of fields inside it.
>> 
>> It's still pretty dubious.  Why not use offsetof?
> offsetof is defined as follows:
> #define offsetof(st, m) \
>     ((size_t) ( (char *)&((st *)(0))->m - (char *)0 ))

Where is that definition?  When using gcc, you should use the <stddef.h>
which gcc provides.  In that file, offsetof is defined as

#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux