Hi Branden, On Wed, Oct 08, 2025 at 02:00:54AM -0500, G. Branden Robinson wrote: > I'm inclined to retain the comments, because it's helpful to me to > identify places where we might migrate from "in-house" facilities to > ones C99, C++98, or gnulib provide. Much of groff is still written like > it's 1989. See Savannah #66672 and #66518. > > > iwyu(1) is what you should be using to keep the correct includes, but > > the comments shouldn't go in the source code. > > First I've heard of this tool. Thanks for bringing it to my attention.
It's still a bit rough regarding system includes. I provided many
patches to iwyu(1) a few years ago regarding detection of libc headers,
as it had some false positives. If you find any issues with it, you can
let me know and I'll send some patches to them.
It's a great tool for having the correct includes. I'm using it in the
build system of the Linux man-pages project to check the EXAMPLES.
I use the following flags when using it, and recommmend using them here
too:
DEFAULT_IWYUFLAGS := \
-Xiwyu --no_fwd_decls \
-Xiwyu --error
(The latter is obvious, but the former is important. The default
behavior is contrary to most project's guidelines.)
I recommend having a make target called 'lint-c-iwyu' for running it
through all of your sources. That's how I call it:
$ make -R -p nothing \
| grep '^\.PHONY:' \
| tr ' ' '\n' \
| grep -v '^\.PHONY:' \
| grep iwyu
make: warning: undefined variable 'GNUMAKEFLAGS'
lint-c-iwyu
Once you integrate that into your build system, I think you'll find the
comments to be useless.
> > See the range-diff below.
>
> You don't need to submit a v5. I'll hand-merge.
Thanks!
> Soonish, but I can't promise a 24-hour turnaround or anything like that.
>
> Regards,
> Branden
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).
signature.asc
Description: PGP signature
