Re: [PATCH] bio: gcc warning fix.

Zan Lynx
2006-01-06T19:34:32Z

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

On Fri, 2006-01-06 at 19:48 +0100, Jens Axboe wrote:
> On Fri, Jan 06 2006, Jesper Juhl wrote:
> > gcc is right to warn in the sense that it doesn't know if
> > bvec_alloc_bs() will read or write into idx when its address is passed
>
> The function is right there, on top of bio_alloc_bioset(). It's even
> inlined. gcc has absolutely no reason to complain.

GCC complains because it is possible for that function to return without
ever setting a value into idx. It's the "default" case in the switch.
Of course, if that happens, idx will not be used and so it is not
actually a problem.
--
Zan Lynx <zlynx@acm.org>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]