Re: [RFC] Proposal to relax warnings of htmldocs

From: Carlos Bilbao
Date: Wed Aug 16 2023 - 10:55:52 EST


On 8/15/23 13:23, Jonathan Corbet wrote:
Carlos Bilbao <carlos.bilbao@xxxxxxx> writes:

Hello all,

I would like to discuss a recurring issue that we all have encountered
while running `make htmldocs`. The process often generates an overwhelming
amount of warnings that are not relevant to our work, which makes it harder
to identify and address actual warning messages related to our changes.

One of the reasons for this is the variation in warnings raised by
different compilers. For instance, the Linux kernel robot employs Sparse,
which recently raised a warning that we (Avadhut in CC, and then me
reviewing his patch) did not catch during our testing [1,2].

Particularly annoying -to me personally- are warnings of the form:

"warning: Function parameter or member 'field' not described in 'struct'"

that seem to enumerate every single undocumented field within a struct.

I would like to propose something to alleviate this issue before the list
of warnings keeps piling up.

...other than fixing the actual problems? :)

I'm happy to fix as many as I can, but there are obstacles e.g. some things
lack documentation, such as undocumented fields in structures with names
that nobody but their creator could decipher. Also, that won't solve the
underlying warning display problem (which maybe it's W!=1, as noted by
Matthew.


I suggest for the command `make htmldocs` to
only display, by default, warnings directly related to the changes being
made, unless explicitly requested otherwisee.

I'm thinking we could do this, for example, by making hmtldocs a two-step
process: First running htmldocs as usual but with warnings disabled, and
then generating docs again but only for the new files (see $git diff
--name-only HEAD), with warnings active but limited to the scope of the
changes made.

A normal build should just generate warnings for files that have
changed (since the last build). Does that not do what you want?

That's not the behavior I see on my system, when I run `make htmldocs` I
see many warnings from other places.It floods my screen. The default
behavior appears to change between configurations and compilers.


Trying to get Sphinx to do smarter things with partial builds seems like
a path to frustration. Since the specific warnings you're talking about
are generated by kernel-doc, a better solution would probably just
invoke it directly. It wouldn't be that hard to bash out a script to
feed a given set of files to kernel-doc and see what it says.

As an alternative, of course, we could consider turning off those
specific warnings entirely for normal builds.

Thanks for explaining, yes, looks like kernel-doc is the place to do
something at.


Thanks,

jon

Thanks,
Carlos