Re: [PATCH] bio: gcc warning fix.

From: Zan Lynx
Date: Fri Jan 06 2006 - 14:33:11 EST


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@xxxxxxx>

Attachment: signature.asc
Description: This is a digitally signed message part