[PATCH] Android: disable unused parameter warnings

Dmitry Shmidt dimitrysh at google.com
Mon Apr 21 15:16:17 EDT 2014


On Thu, Apr 17, 2014 at 7:29 AM, Jouni Malinen <j at w1.fi> wrote:
> On Tue, Apr 15, 2014 at 08:16:32AM +0300, Kalle Valo wrote:
>> Greg Hackmann <ghackmann at google.com> writes:
>> > diff --git a/hostapd/Android.mk b/hostapd/Android.mk
>> > @@ -24,6 +24,9 @@ L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
>> > +# Disable unused parameter warnings
>> > +L_CFLAGS += -Wno-unused-parameter
>>
>> Wouldn't it be better to fix the actual warnings?
>
> Depends on what you mean by fixing them.. I did not even know that
> someone would compile with -Wunused-parameter (or well, maybe more
> likely with -Wextra without disabling this specific warning). This
> results in 3522 "unused parameter" warning with my build configuration.

Apparently is what Android build system is doing - it sets -Wextra, so
-Wunused-parameter will be very helpful to avoid these 3522 warnings.

>
> I'm using "-Wextra -Wno-unused-parameter" for a good reason of getting
> rid of these bogus warnings. It is not an error, or worth a warning,
> IMHO, if a function does not use every single parameter. There is a
> large number of function pointers in wpa_supplicant/hostapd for
> implementing generic interfaces like EAP method operations or
> configuration parsers. Some EAP methods may need all the parameters,
> many don't. Trying to somehow encode every such location with
> __attribute__((unused)) to avoid this warning sounds both useless work
> and ugly in the end.
>
> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap


More information about the HostAP mailing list