Skip to contentSkip to conversation

Fix misleading gcc4 warning, idx may be used uninitialized

PATCH In review [email protected] 3 participants 3 messages Jun 20, 2005 – Jun 21, 2005 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix misleading gcc4 warning, idx may be used uninitialized

From: Jesse Millan <[email protected]>

This warning is a false alarm.

This patch eliminates the warning that idx may be used uninitialized in the function bvec_alloc_bs().

---
 bio.c |    1 +
 1 files changed, 1 insertion(+)
fs/bio.c +1 -0
Index: quilt/fs/bio.c
===================================================================
@@ -78,6 +78,7 @@ static inline struct bio_vec *bvec_alloc
 {
 	struct bio_vec *bvl;
 	struct biovec_slab *bp;
+	*idx = 0;
 
 	/*
 	 * see comment near bvec_array define!

--

#1 lore raw
Quoted 2 lines · On Mon, 20 June 2005 23:56:48 +0200, [email protected] wrote:

This warning is a false alarm.

Yep, it is. Would be much nicer to teach gcc about it.

Jörn

Signature · 6 lines
"Translations are and will always be problematic. They inflict violence 
upon two languages." (translation from German)
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to [email protected]
Quoted 22 lines · On Mon, Jun 20 2005, [email protected] wrote:

From: Jesse Millan <[email protected]>

This warning is a false alarm.

This patch eliminates the warning that idx may be used uninitialized in the function bvec_alloc_bs().

---
 bio.c |    1 +
 1 files changed, 1 insertion(+)

Index: quilt/fs/bio.c
===================================================================

fs/bio.c static inline struct bio_vec *bvec_alloc · line 84

Quoted 7 lines
fs/bio.c +1 -0
@@ -78,6 +78,7 @@ static inline struct bio_vec *bvec_alloc
 {
 	struct bio_vec *bvl;
 	struct biovec_slab *bp;
+	*idx = 0;
 
 	/*
 	 * see comment near bvec_array define!

Rejected, the gcc warning is (as you note) a false alarm. So fix gcc.

Signature · 1 line
Jens Axboe