Re: [PATCH 00/17] Add memberof(), split some headers, and slightly simplify code
From: Alejandro Colomar (man-pages)
Date: Fri Nov 19 2021 - 10:43:09 EST
On 11/19/21 16:38, Alejandro Colomar (man-pages) wrote:
> On 11/19/21 16:34, Andy Shevchenko wrote:
>> On Fri, Nov 19, 2021 at 04:06:27PM +0100, Alejandro Colomar (man-pages) wrote:
>>> Yes, I would like to untangle the dependencies.
>>> The main reason I started doing this splitting
>>> is because I wouldn't be able to include
>>> <linux/stddef.h> in some headers,
>>> because it pulled too much stuff that broke unrelated things.
>>> So that's why I started from there.
>>> I for example would like to get NULL in memberof()
>>> without puling anything else,
>>> so <linux/NULL.h> makes sense for that.
>> I don't believe that the code that uses NULL won't include types.h.
> I'm not sure about the error I got (I didn't write it down),
> but I got a compilation error.
> That's why I split NULL.
Now that I think about it twice,
since I'm rewriting these changes from scratch,
I think the error might have been
not due to pulling too much stuff,
but due to circular dependencies.
Having more granularity
helps precisely define the dependencies.
I think the problem was in
<linux/memberof.h> requiring NULL from <linux/stddef.h>
<linux/stddef.h> requiring memberof() from <linux/memberof.h>
or something like that.
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/