[Spice-devel] [PATCH 7/9] common: add ring_get_length() for debugging purposes

Marc-André Lureau marcandre.lureau at gmail.com
Wed Apr 27 09:00:25 PDT 2011


-Wunused-function
Warn whenever a static function is declared but not defined or a
non-inline static function is unused. This warning is enabled by
-Wall.

I don't know if there is a flag to warn about unused static inline function.

 ring.h contains many inline functions that are not necessarily used
in all compilation units, so it's just one more function here.

On Wed, Apr 27, 2011 at 5:53 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> On Wed, Apr 27, 2011 at 10:24:01AM -0400, Marc-André Lureau wrote:
>> > Do you mean it should be #ifdef'ed? or that it's better to add the
>> > equivalent of G_GNUC_UNUSED to the function definition to avoid the
>> > compiler
>> > warning?
>>
>> Is there such warning? I was expecting unused inline functions not to produce warning.
>> The ifdef shouldn't be necessary. It's just one more functions, similar to the other provided in ring.h
>
> Not sure we get such a warning with the default spice cflags, but it's easy
> to get gcc to warn about such "dead" code (unused static functions)
>
> Christophe
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
>



-- 
Marc-André Lureau


More information about the Spice-devel mailing list