Page MenuHomeFreeBSD

sys/stddef.h: guard offsetof definition
AcceptedPublic

Authored by brooks on Mon, Feb 16, 1:49 PM.

Details

Reviewers
kib
Summary

Without this, including sys/stddef.h after stddef.h can trigger a
warning which may become an error. This isn't something FreeBSD code
should do, but it does happen sometimes with compatibility headers so
support it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 70696
Build 67579: arc lint + arc unit

Event Timeline

The change by itself is fine.

This is a related comment. sys/stddef.h definition for offsetof() uses offsetof() instead of builtin_offsetof(). Then, should we have e.g. sys/_offsetof.h with include guard, then this issue would be handled automatically?

This revision is now accepted and ready to land.Mon, Feb 16, 2:32 PM