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, Nov 4, 11:18 PM
Unknown Object (File)
Thu, Oct 31, 10:05 AM
Unknown Object (File)
Sep 30 2024, 1:25 AM
Unknown Object (File)
Sep 23 2024, 3:57 AM
Unknown Object (File)
Sep 22 2024, 11:05 PM
Unknown Object (File)
Sep 22 2024, 7:52 PM
Unknown Object (File)
Sep 22 2024, 7:36 PM
Unknown Object (File)
Sep 21 2024, 4:53 PM

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