tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] style(5): No struct typedefs




> On Jul 11, 2023, at 9:51 PM, Robert Elz <kre%munnari.OZ.AU@localhost> wrote:
> 
> That is to rip the definition of __NetBSD_Version__  (with however
> nany underscores it really has) out of <sys/param.h> and into a new
> header file all of its own <sys/netbsd-version.h> (perhaps - no bikeshedding
> about names here please) with the rule that *no* other header file is
> oermitted to include it.   C code that needs __NetBSD_Version__ needs
> to explcitly include that file itself ... there is surprisingly little
> of it.   This will make the side effects of doing a kernel version bump
> be so small (really, so it should be) that doing one is an automatic
> decision any time it might be needed, and we end the "even though this
> is a kernel internal ABI change, I don't think any modules will be affected"
> (and no no bump happens - which must be what happens sometimes, either that
> of some of our developers don't understand what a kernal internal ABI
> change means) and should also avoid the need for "ride the kernel
> version bump" (perhaps several hours later) or "let me know when you're
> going to bump the kernel version, I have changes to commit which would
> need that, but don't need to be commmitted right away" - which often
> turns into a "ride the bump" when the developer who did a change, and
> a bump, did not remeber, or perhaps even know, the other developer was
> waiting and would have likes to coordinate.

I’ve been thinking about this a little more…

What about something like <sys/typedefs/whatever.h> and <sys/impl/whatever_impl.h>?  The type definitions go into the former header file, that can be included by whatever other header needs that type definition.  The full-blown structure and internal details of it go into the latter, to be only included by things that access the guts, and now it’s VERY clear that “I am using implementation details” aspect of touching those guts.

-- thorpej



Home | Main Index | Thread Index | Old Index