[webkit-dev] Unused parameter warnings / errors / warning fixes

Filip Pizlo fpizlo at apple.com
Mon Jan 26 07:52:39 PST 2015

> On Jan 26, 2015, at 6:40 AM, Osztrogonác Csaba <oszi at inf.u-szeged.hu> wrote:
> Hi all,
> I noticed many patches to fix newly introduced unused
> parameter warnings on GTK and EFL ports nowadays.
> (ToT EFL WebKit is warning free right now.)
> CMake ports now handle unused parameters as warnings, not build
> errors everywhere. (-Werror and -Wno-error=unused-parameter )
> Mac port handles them as build errors, except in WebKit, WebKit2
> and WebInspectorUI, where it is disabled (-Wno-unused-parameter)
> WebInspectorUI  is warning free now, but there are zillion warnings
> in WebKit and Webkit2.
> It would be great if we can handle unused parameters in the same way:
> - treat them as errors
> - treat them as warnings and fix sometimes
> - disable them and don't try to fix again and again
>  (and maybe remove zillion UNUSED_PARAM warning fixes )

Disabling it entirely would be great. I have spent many hours during my WebKit career fixing these errors, and they have never been indicative of an actual mistake - it's just noise to spoon feed the compiler.

This error is the most common way that platform differences become build failures. It's common for code enabled on only one platform to fail to build on other platforms because someone forgot the UNUSED_PARAM thing. This then leads to a lot of rollouts or follow-up fixes, which isn't a good use of time. 

I'd be curious to hear if anyone was ever alerted to a serious bug in their code by an unused parameter error. I'd like to weigh the likelihood of that against all of the time we spend working around this error in otherwise correct code. Personally I've never been alerted to a real bug by this. 

> I played a little bit to see if it is possible to get rid these warnings
> easily on Mac too and then handle the new ones as build failres:
> https://bugs.webkit.org/show_bug.cgi?id=140764
> But I'm not sure if treating unused parameters as errors would be good
> idea, because many of them depend on different feature ifdef guards
> and it might cause more frequent build failures. Maybe disabling them
> would be better.
> Ideas, opinions, concerns and suggestions are welcome.
> br,
> Ossy
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev

More information about the webkit-dev mailing list