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
F163093393: D54009.id167356.diff
Mon, Jul 20, 12:47 AM
Unknown Object (File)
Sun, Jul 19, 3:05 AM
Unknown Object (File)
Sun, Jul 19, 2:54 AM
Unknown Object (File)
Wed, Jul 15, 6:57 AM
Unknown Object (File)
Wed, Jul 15, 6:57 AM
Unknown Object (File)
Tue, Jul 14, 6:53 AM
Unknown Object (File)
Fri, Jul 3, 6:19 PM
Unknown Object (File)
Sat, Jun 27, 8:56 AM
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 68953
Build 65836: 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.Dec 15 2025, 5:19 PM
This revision is now accepted and ready to land.Dec 16 2025, 6:46 AM
This revision was automatically updated to reflect the committed changes.