Thread (21 messages) 21 messages, 6 authors, 2021-11-23

Re: [PATCH 00/17] Add memberof(), split some headers, and slightly simplify code

From: Alejandro Colomar (man-pages) <hidden>
Date: 2021-11-19 16:22:56
Also in: intel-gfx, linux-acpi, linux-btrfs, linux-scsi, lkml, netdev


On 11/19/21 17:18, Arnd Bergmann wrote:
On Fri, Nov 19, 2021 at 5:10 PM Andy Shevchenko
[off-list ref] wrote:
quoted
On Fri, Nov 19, 2021 at 04:57:46PM +0100, Arnd Bergmann wrote:
quoted
quoted
The main problem with this approach is that as soon as you start
actually reducing the unneeded indirect includes, you end up with
countless .c files that no longer build because they are missing a
direct include for something that was always included somewhere
deep underneath, so I needed a second set of scripts to add
direct includes to every .c file.
Can't it be done with cocci support?
There are many ways of doing it, but they all tend to suffer from the
problem of identifying which headers are actually needed based on
the contents of a file, and also figuring out where to put the extra
#include if there are complex #ifdefs.

For reference, see below for the naive pattern matching I tried.
This is obviously incomplete and partially wrong.
FYI, if you may not know the tool,
theres include-what-you-use(1) (a.k.a. iwyu(1))[1],
although it is still not mature,
and I'm helping improve it a bit.

If I understood better the kernel Makefiles,
I'd try it.

You can try it yourselves.
I still can't use it for my own code,
since it has a lot of false positives.

Cheers,
Alex

[1]: <https://include-what-you-use.org/>


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help