36128dff44
[BUG] When compiling the devel branch with commit fb8f05e40b458 ("btrfs-progs: check: Make repair_imode_common() handle inodes in subvolume trees"), the following warning will be reported: check/mode-common.c: In function ‘detect_imode’: check/mode-common.c|1071 col 23| warning: ‘imode’ may be used uninitialized in this function [-Wmaybe-uninitialized] 1071 | *imode_ret = (imode | 0700); | ~~~~~~~^~~~~~~ This only occurs for regular build. If compiled with D=1, the warning just disappears. [CAUSE] Looks like a bug in gcc optimization. The code will only set @imode_ret when @found is true. And for every "found = true" assignment we have assigned @imode. So this is just a false alert. [FIX] I hope I can fix the problem of GCC, but obviously I can't (at least for now). So let's assign an initial value 0 to @imode to suppress the false alert. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
common.h | ||
main.c | ||
mode-common.c | ||
mode-common.h | ||
mode-lowmem.c | ||
mode-lowmem.h | ||
mode-original.h | ||
qgroup-verify.c | ||
qgroup-verify.h |