[PATCH] Android: disable unused parameter warnings
Jouni Malinen
j
Thu Apr 17 07:29:20 PDT 2014
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.
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
More information about the Hostap
mailing list