e2fsprogs/e2fsprogs-uninitialized.diff

34 lines
1.1 KiB
Diff

# bk@suse.de:
# This patch is just here to silence the (in this case) stupid gcc warning,
# where gcc says that b is used uninitialized. "may" whould have been more
# correct, but even that is wrong because as block_ind_bmap() where the
# uninitialized access could have happened, is declared static and both
# callers which gcc warns about call block_ind_bmap() with flags & ~BMAP_SET,
# which means that
# if (flags & BMAP_SET) {
# b = *ret_blk;
# which is the line which gcc offends, is never reached, so that's a clearly
# bogus "is using uninitialized" warning. Anyway, to prevent others from
# investgating again, just initialize them:
#
--- lib/ext2fs/bmap.c
+++ lib/ext2fs/bmap.c
@@ -99,7 +99,7 @@ static _BMAP_INLINE_ errcode_t block_din
int *blocks_alloc,
blk_t nr, blk_t *ret_blk)
{
- blk_t b;
+ blk_t b = 0;
errcode_t retval;
blk_t addr_per_block;
@@ -119,7 +119,7 @@ static _BMAP_INLINE_ errcode_t block_tin
int *blocks_alloc,
blk_t nr, blk_t *ret_blk)
{
- blk_t b;
+ blk_t b = 0;
errcode_t retval;
blk_t addr_per_block;