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:47:08
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2021-09-19 22:47:08
On Mon, Sep 20, 2021 at 06:44:58AM +0800, Qu Wenruo wrote:
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.
= { }; is not a problem for that version of GCC. Why do you think it's
problematic?
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!