Page MenuHomeFreeBSD

kassert: Explicitly include <sys/_types>
ClosedPublic

Authored by olce on Apr 23 2025, 10:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 13, 2:11 PM
Unknown Object (File)
Thu, Nov 13, 3:59 AM
Unknown Object (File)
Wed, Nov 12, 9:40 PM
Unknown Object (File)
Mon, Nov 10, 5:04 AM
Unknown Object (File)
Sun, Nov 9, 1:15 AM
Unknown Object (File)
Sun, Oct 26, 4:32 AM
Unknown Object (File)
Sat, Oct 25, 9:12 AM
Unknown Object (File)
Sep 25 2025, 11:57 AM
Subscribers

Details

Summary

Including it is needed to have '__va_list' defined.

This is a step to make <sys/kassert.h> usable without the need to
explicitly include other headers.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63659
Build 60543: arc lint + arc unit

Event Timeline

olce requested review of this revision.Apr 23 2025, 10:04 AM

title should likely say _types.h though.
And do you still need cdefs.h, since _types.h already does? style(9) says types.h, but maybe we need to update that too?

This revision is now accepted and ready to land.Apr 23 2025, 8:49 PM
In D49972#1140034, @imp wrote:

title should likely say _types.h though.
And do you still need cdefs.h, since _types.h already does? style(9) says types.h, but maybe we need to update that too?

I could have sworn that style.9 says that one can assume that param.h and (_)types.h include cdefs.h, but I can't find any mention of that.

IMO it's okay to drop the cdefs include, but it doesn't matter much here.

Title will be fixed on commit.

In D49972#1140034, @imp wrote:

And do you still need cdefs.h, since _types.h already does? style(9) says types.h, but maybe we need to update that too?

I could have sworn that style.9 says that one can assume that param.h and (_)types.h include cdefs.h, but I can't find any mention of that.

I regularly think similarly, and regularly re-read style.9 to remind me it's indeed not there.

I'm fine with adding such a stance in style.9, as it seems this is already what people automatically assume. That said, I also think we should limit the number of such rules, and stick to explicit includes of directly referenced types/objects, except for technical/historical reasons/shortcomings or long-established practice.

IMO it's okay to drop the cdefs include, but it doesn't matter much here.

This header directly uses features of cdefs.h (such as __printflike), so unless/until we decide on an official stance about cdefs.h being included by _types.h, I'd rather not remove the explicit include.

This revision was automatically updated to reflect the committed changes.