HomeFreeBSD

stddef.h: centralize definition of offsetof()

Description

stddef.h: centralize definition of offsetof()

Move to sys/_offsetof.h and use builtin_offsetof() instead of
offsetof to avoid reintroducing sys/cdefs.h polution in stddef.h.

This has the side effect of allowing sys/stddef.h to be included after
stddef.h which can happen in compatability headers.

Effort: CHERI upstreaming
Sponsored by: DARPA, AFRL
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D55307

Details

Provenance
brooksAuthored on Feb 19 2026, 3:05 PM
Reviewer
imp
Differential Revision
D55307: stddef.h: centralize definition of offsetof()
Parents
rGcb59eec9ebbf: stddef.h: add ptraddr_t
Branches
Unknown
Tags
Unknown