Re: [PATCH] btrfs: fix initialiser warning in fs/btrfs/tree-checker.c
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2021-09-19 22:51:07
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2021-09-19 22:51:07
On Sun, Sep 19, 2021 at 11:46:59PM +0100, Russell King (Oracle) wrote:
On Mon, Sep 20, 2021 at 06:44:58AM +0800, Qu Wenruo wrote:quoted
On 2021/9/20 06:40, Russell King (Oracle) wrote:quoted
Debian gcc 10.2.1 complains thusly: fs/btrfs/tree-checker.c:1071:9: warning: missing braces around initializer [-Wmissing-braces] struct btrfs_root_item ri = { 0 }; ^ fs/btrfs/tree-checker.c:1071:9: warning: (near initialization for 'ri.inode') [-Wmissing-braces] Fix it by removing the unnecessary '0' initialiser, leaving the braces.This should be a compiler bug. = { 0 }; is completely fine here, in fact = { }; would be more problematic. What's the compiler version? I haven't hit such problem for GCC 11.1.0 nor clang 12.0.1.I just realised that it's not the compiler I thought it was - It's GCC 4.9.4 used on 32-bit ARM.
Okay, ignore this - the warning exists with 5.14, where 4.9.4 is still a valid compiler, but no longer with 5.15-rc. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!