All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>,
	Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix initialiser warning in fs/btrfs/tree-checker.c
Date: Mon, 20 Sep 2021 06:57:18 +0800	[thread overview]
Message-ID: <1159c919-39aa-0a03-6963-b367863ded7b@suse.com> (raw)
In-Reply-To: <YUe94+ksRJrkqp16@shell.armlinux.org.uk>



On 2021/9/20 06:46, Russell King (Oracle) wrote:
> 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.

That's bare minimal GCC version required for kernel build.

I'm not sure if that old version has all the correct backports.

> 
> = { }; is not a problem for that version of GCC. Why do you think it's
> problematic?
> 

Isn't initialization with empty initializers against C89/90 standard?

Thanks,
Qu


  parent reply	other threads:[~2021-09-19 22:57 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)
2021-09-19 22:50     ` Russell King (Oracle)
2021-09-19 22:57     ` Qu Wenruo [this message]
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=1159c919-39aa-0a03-6963-b367863ded7b@suse.com \
    --to=wqu@suse.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=quwenruo.btrfs@gmx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.