From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>, Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix initialiser warning in fs/btrfs/tree-checker.c
Date: Sun, 19 Sep 2021 23:46:59 +0100 [thread overview]
Message-ID: <YUe94+ksRJrkqp16@shell.armlinux.org.uk> (raw)
In-Reply-To: <b4f6ec59-daa8-d4bd-d6b9-25d854eb70c3@gmx.com>
On Mon, Sep 20, 2021 at 06:44:58AM +0800, Qu Wenruo wrote:
>
>
> On 2021/9/20 06:40, Russell King (Oracle) wrote:
> > 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!
next prev parent reply other threads:[~2021-09-19 22:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-19 22:40 [PATCH] btrfs: fix initialiser warning in fs/btrfs/tree-checker.c Russell King (Oracle)
2021-09-19 22:44 ` Qu Wenruo
2021-09-19 22:46 ` Russell King (Oracle) [this message]
2021-09-19 22:50 ` Russell King (Oracle)
2021-09-19 22:57 ` Qu Wenruo
2021-09-20 8:12 ` David Sterba
2021-09-20 8:25 ` Qu Wenruo
2021-09-20 8:31 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YUe94+ksRJrkqp16@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox