Page MenuHomeFreeBSD

sys/_types.h: avoid use of __has_feature()
ClosedPublic

Authored by brooks on Dec 1 2025, 10:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 10, 6:34 AM
Unknown Object (File)
Fri, Jan 9, 7:14 PM
Unknown Object (File)
Fri, Jan 9, 4:42 PM
Unknown Object (File)
Tue, Dec 30, 2:26 AM
Unknown Object (File)
Sun, Dec 28, 7:48 AM
Unknown Object (File)
Fri, Dec 26, 3:46 AM
Unknown Object (File)
Mon, Dec 22, 10:19 PM
Unknown Object (File)
Fri, Dec 19, 11:48 PM
Subscribers

Details

Summary

Only fairly recent GCC versions support and sys/_types.h must work with
quite old compilers and without sys/cdef.h being included. The prior
workaround works fine, but we can have the same effect with compiler
macro definitions.

This reverts commit 029a09f18032353a9ae874590b879322efc6e53a
This reverts commit 19728f31ae421f40e2b0b0c775f4eedd7f927be0

Effort: CHERI upstreaming
Fixes: 85ab981a8e4e ("sys/_types.h: define fallback __(u)intcap_t")
Sponsored by: Innovate UK

Diff Detail

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

Event Timeline

sys/sys/_types.h
164

The most optimal gate would probably be !defined(__INTCAP_TYPE__) since it's a fundamental type provided by the compiler, but we seem to have forgotten to define that macro. I've filed a bug report on that lack https://github.com/CTSRD-CHERI/llvm-project/issues/796

This revision is now accepted and ready to land.Dec 1 2025, 7:07 PM

Switch to checking for SIZEOF_INTCAP. The compiler will define it
if it implements __intcap_t.

This revision now requires review to proceed.Mon, Dec 15, 5:19 PM
This revision is now accepted and ready to land.Tue, Dec 16, 6:46 AM
This revision was automatically updated to reflect the committed changes.