Skip to contentSkip to conversation

qcow2: Silence false warning

PATCH Applied Kevin Wolf 2 participants 2 messages Jun 15, 2012 Block layer

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 qcow2: Silence false warning

Some gcc versions seem not to be able to figure out that the switch statement covers all possible values and that c is therefore always initialised. Add a default branch for them.

---
 block/qcow2-cluster.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
block/qcow2-cluster.c +2 -0
index b663b9f..d7e0e19 100644
@@ -471,6 +471,8 @@ int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset,
                 QCOW_OFLAG_COMPRESSED | QCOW_OFLAG_ZERO);
         *cluster_offset &= L2E_OFFSET_MASK;
         break;
+    default:
+        abort();
     }
 
     qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table);
Signature · 1 line
1.7.6.5
Applied
#1 lore raw
Quoted 4 lines · Kevin Wolf

Some gcc versions seem not to be able to figure out that the switch statement covers all possible values and that c is therefore always initialised. Add a default branch for them.

Applied, thanks.

Signature · 1 line
mailto:[email protected]