Page MenuHomeFreeBSD

LinuxKPI: Use negative bit field size to trigger BUILD_BUG_ON_ZERO
ClosedPublic

Authored by wulf on Dec 27 2021, 11:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 24, 6:03 AM
Unknown Object (File)
Feb 27 2025, 8:53 PM
Unknown Object (File)
Feb 24 2025, 4:41 PM
Unknown Object (File)
Feb 4 2025, 5:26 AM
Unknown Object (File)
Feb 3 2025, 11:31 PM
Unknown Object (File)
Jan 26 2025, 3:10 PM
Unknown Object (File)
Jan 18 2025, 6:07 AM
Unknown Object (File)
Jan 14 2025, 2:03 AM

Details

Summary

compile time assertion on non-NULL pointers. Tests conducted show that
_Static_assert, negative array size method and current code does not
handle pointers well enough. Bit field method solves this problem.

This change is derrived from Linux implementation of BUILD_BUG_ON_ZERO.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable