Missing LIST_PREV() ?

Bruce Evans bde at zeta.org.au
Wed May 9 09:59:40 UTC 2007


On Tue, 8 May 2007, Julian Elischer wrote:

> Kostik Belousov wrote:
>> On Tue, May 08, 2007 at 11:28:25AM -0400, John Baldwin wrote:

>>> I'm not sure how portable offsetof() would be though.  In general if you 
>>> want 
>> 
>> offsetof() itself is defined by C standard to be present both in
>> freestanding and hosted environment (and be available by stddef.h).
>
> You learn something every day! interesting (but still scary)..

Quite a lot of standard headers are required to be present in freestanding
environments: float.h, iso646.h, limits.h, stdarg.g, stdbool.h, stddef.h
and stdint.h.  Of course, these aren't required to have their usual
extensions and pollution (e.g., POSIX limits in limits.h), but just things
like INT_MAX which don't depend on the library.

offsetof() isn't usable in sys/queue.h, but sys/queue.h already uses
the equivalent __offsetof() for similar purposes.

Bruce


More information about the freebsd-arch mailing list