[alsa-devel] ASoC updates for 2.6.37
Takashi Iwai
tiwai at suse.de
Mon Sep 27 10:30:31 CEST 2010
At Mon, 27 Sep 2010 09:21:14 +0100,
Dimitris Papastamos wrote:
>
> > sound/soc/codecs/wm8985.c: In function 'wm8985_hw_params':
> > sound/soc/codecs/wm8985.c:731:2: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
> >
> > Actually the variable is fine as int.
>
> I'd guess the expected fix is to change '%d' to '%zu'. The reason for it
> being size_t is that is used in an expression involving ARRAY_SIZE(...)
> which uses sizeof. But it does not really matter in actual fact because
> the array will never be large enough to cause sign confusion.
Yeah, I do understand the initial intention, but size_t for such a
case (just for an index of a small fixed size array) is obviously too
much. If it must be size_t, it shouldn't be a variable name like "i"
but a more specific name.
thanks,
Takashi
More information about the Alsa-devel
mailing list