diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2010-09-09 13:50:26 +0800 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-09-23 20:26:49 -0400 |
commit | 6ac03d3a285547cd376767d7365b7315b6eb115c (patch) | |
tree | 4d58635d6688ed0cf7ee6025813518e14c561458 | |
parent | 6c94ed24794d5a44a2ab4cde652e80eba05ade7a (diff) |
Avoid uninitialized variant compile warning
When we compile btrfs-progs in RHEL5(with default gcc version 4.1.2 20070626),
we can get following error:
cc1: warnings being treated as errors
btrfs-list.c: In function 'find_updated_files':
btrfs-list.c:668: warning: 'disk_offset' may be used uninitialized in this function
btrfs-list.c:667: warning: 'disk_start' may be used uninitialized in this function
btrfs-list.c:666: warning: 'len' may be used uninitialized in this function
make: *** [btrfs-list.o] Error 1
These varient are always initialized except inconsistent data in file system.
We can set initial value for these variant for this situation.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
-rw-r--r-- | btrfs-list.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/btrfs-list.c b/btrfs-list.c index 9dedb5d2..112bed25 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -663,9 +663,9 @@ static int print_one_extent(int fd, struct btrfs_ioctl_search_header *sh, char **cache_dir_name, u64 *cache_ino, char **cache_full_name) { - u64 len; - u64 disk_start; - u64 disk_offset; + u64 len = 0; + u64 disk_start = 0; + u64 disk_offset = 0; u8 type; int compressed = 0; int flags = 0; |