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, Apr 8, 3:10 AM
Unknown Object (File)
Apr 5 2024, 9:08 PM
Unknown Object (File)
Dec 22 2023, 11:54 PM
Unknown Object (File)
Dec 12 2023, 5:41 PM
Unknown Object (File)
Nov 24 2023, 8:48 PM
Unknown Object (File)
Aug 28 2023, 7:31 PM
Unknown Object (File)
Jul 8 2023, 8:20 PM
Unknown Object (File)
Jul 8 2023, 8:20 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