ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Add -Wdocumentation

From: Bálint Réczey <balint@xxxxxxxxxxxxxxx>
Date: Fri, 13 Dec 2013 15:27:09 +0100
Hi,

2013/12/13 Alexis La Goutte <alexis.lagoutte@xxxxxxxxx>:
>
> Hi,
>
> On Mon, Dec 9, 2013 at 5:58 PM, Bálint Réczey <balint@xxxxxxxxxxxxxxx>
> wrote:
>>
>> 2013/12/9 Joerg Mayer <jmayer@xxxxxxxxx>:
>> > On Fri, Dec 06, 2013 at 03:38:08PM +0100, Alexis La Goutte wrote:
>> >> I plan to add -Wdocumentation [1] by default to Wireshark (when build
>> >> with
>> >> Clang).
>> >> I have already fix in trunk the documentation.
>> >>
>> >> The major issue to add -Wdocumentation is other library (like
>> >> glib/gtk...)
>> >> It is don't use doxygen and make a lot of error.
>> >>
>> >> To fix this, i use pragma to disable error for glib.h or gtk using a
>> >> wrapper (like wsgcrypt.h)
>> >>
>> >> I attach the patch for gtk.h (the patch for glib.h is to big
>> >> (>500ko)...
>> >> because modified all dissector !)
>> >>
>> >> It is ok for you ?
>> >
>> > This solution looks like overkill to me (touching lots and lots of
>> > actual
>> > source files). Isn't there a way to handle this (at least mostly) via
>> > the
>> > build mechanisms
>>
>> I agree with Joerg, I think this -Wdocumentation flag badly needs a
>>
>> way of excluding headers in /usr/include and /usr/local/include .
>
> I not found other solution, to don't include /usr/*/include...
I mean this would be a necessary feature in Clang to support excluding
warnings from system headers.
Apparently it ignores those warnings by default and you can enable
warnings using -Wsystem-headers,
but headers found on -I paths are not considered to be system headers.

>
>>
>> An alternative solution could be running Doxygen  and processing its
>> result/output, and I think it would work, too.
>>
> Yes, but -Wdocumentation found some warning/error no found by Doxygen and it
> is include to build system (no need to have doxygen and graphviz...)
> I use just a wrapper (like libcrypt.h) !
Instead of using a wrapper I suggest adding a flag to clang to let
users extend the system header paths.
It would solve our problem and let many other projects benefit from it.

Cheers,
Balint

[1] http://clang-developers.42468.n3.nabble.com/Clang-Suppress-static-analysis-of-system-header-files-td4026991.html