[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aae5da96-556f-a333-87b1-d6a90a827665@gmail.com>
Date: Sat, 20 Nov 2021 23:24:32 +0300
From: Maxim Petrov <mmrmaximuzz@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2] Add missing headers to the project
Hello Stephen!
On 11/20/21 8:26 PM, Stephen Hemminger wrote:
> Would be better to do this with an existing tool like IncludeWhatYouUse
> Is this what you did?
This is my fault, I didn't even think about searching for any existing tools for
this task. :)
I just wrote a stupid loop over the header files like this:
```bash
for hdr in $(find . -name *.h)
do
printf '#include "%s"' $hdr > headertest.c
gcc headertest.c -c -I ./include -I ./include/uapi
done
```
and then manually patched the files until there are no compilation errors.
It seems like I reinvented the wheel and did it not so good. I targeted only
header files and fixed only compilation errors, possibly keeping some transitive
includes. IWYU looks much better as it targets usage, not just compilation
errors. If you can run this tool and fix the whole project automagically, then
it is better to ignore my patch. Anyway, thank you for the information, I will
definitely try IWYU soon.
Max
Powered by blists - more mailing lists