[Bug 1941] Whither RTEMS_offsetof?

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Thu Oct 20 11:33:48 UTC 2011


--- Comment #3 from Sebastian Huber <sebastian.huber at embedded-brains.de> 2011-10-20 06:33:48 CDT ---
(In reply to comment #2)
> (In reply to comment #1)
> > We should implement it in terms of what the C standard provides <stddef.h>:
> > 
> > http://pubs.opengroup.org/onlinepubs/009604499/basedefs/stddef.h.html
> I don't understand, what you are trying to say.

I would do this:

#include <stddef.h>

#define RTEMS_offsetof(type, member) offsetof(type, member)

> GCC's offsetof is compliant to C99/POSIX => RTEMS_offsetof is meaningless and
> an potential faulty anachronism.

I would avoid the direct usage of the GCC offsetof builtin.

Was RTEMS_offsetof intended for internal use or part of a public API?

Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the bugs mailing list