We can't assume that <sys/cdefs.h> is in scope.
Fixes: 85ab981a8e4e ("sys/_types.h: define fallback __(u)intcap_t")
Differential D53980
sys/_types.h: Unbreak gcc build Authored by des on Nov 28 2025, 5:11 PM. Tags None Referenced Files
Details We can't assume that <sys/cdefs.h> is in scope. Fixes: 85ab981a8e4e ("sys/_types.h: define fallback __(u)intcap_t")
Diff Detail
Event TimelineComment Actions For the record: Clang documents __has_feature() as a function-like macro, but GCC only says it's a "special operator", was introduced for compatibility with clang and recommends against using it. In any case, we are already testing for whether __has_feature is defined or not in sys/cdefs.h, so we know that works. The GCC folks must indeed have taken the full compatibility route, which is sensible. Comment Actions Because ever since someone¹ added tools/build/test-includes/Makefile to our tree four years ago, we test on every buildworld that most headers can be included without prerequisites, and <sys/_types.h> is included by <sys/_callout.h> which is included by <sys/callout.h> and none of those includes <sys/cdefs.h>. ¹ that someone was you |