gfs2_fsck: Fix operation on 'ptr' may be undefined warnings
PATCH 1/1 gfs2_fsck: Fix operation on 'ptr' may be undefined warnings
Occurrences of *ptr++ in fs_recovery.c made gcc throw up "operation on 'ptr' may be undefined" warnings. This patch disambiguates those occurrences.
Signed-off-by Andrew Price <[email protected]>
--- gfs2/fsck/fs_recovery.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
gfs2/fsck/fs_recovery.c +6 -3
@@ -125,7 +125,8 @@ static int buf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start, sd_found_metablocks++; - blkno =be64_to_cpu (*ptr++); + blkno =be64_to_cpu (*ptr); + ptr++;if (gfs2_revoke_check (sdp, blkno, start))continue ;
@@ -218,8 +219,10 @@ static int databuf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,gfs2_replay_incr_blk (ip, &start);for (; blks;gfs2_replay_incr_blk (ip, &start), blks--) { - blkno =be64_to_cpu (*ptr++); - esc =be64_to_cpu (*ptr++); + blkno =be64_to_cpu (*ptr); + ptr++; + esc =be64_to_cpu (*ptr); + ptr++; sd_found_jblocks++;
Signature · 1 line
1.5.4.4
PATCH 1/1 gfs2_fsck: Fix operation on 'ptr' may be undefined warnings
The patch is now in master and STABLE2 branches.
Thanks
Fabio
Quoted 38 lines · Andrew Price
Occurrences of *ptr++ in
fs_recovery.cmade gcc throw up "operation on 'ptr' may be undefined" warnings. This patch disambiguates those occurrences.Signed-off-by Andrew Price <[email protected]>---
gfs2/fsck/fs_recovery.c| 9 ++++++---1 files changed, 6 insertions(+), 3 deletions(-)gfs2/fsck/fs_recovery.c +6
-3@@ -125,7 +125,8 @@ static int buf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start, sd_found_metablocks++; - blkno =be64_to_cpu (*ptr++); + blkno =be64_to_cpu (*ptr); + ptr++;if (gfs2_revoke_check (sdp, blkno, start))continue ;@@ -218,8 +219,10 @@ static int databuf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,gfs2_replay_incr_blk (ip, &start);for (; blks;gfs2_replay_incr_blk (ip, &start), blks--) { - blkno =be64_to_cpu (*ptr++); - esc =be64_to_cpu (*ptr++); + blkno =be64_to_cpu (*ptr); + ptr++; + esc =be64_to_cpu (*ptr); + ptr++; sd_found_jblocks++;Signature · 1 line
1.5.4.4
--
I'm going to make him an offer he can't refuse.