Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp605924ybz; Wed, 15 Apr 2020 15:01:43 -0700 (PDT) X-Google-Smtp-Source: APiQypKmxNGvyPjIu3uC7VcybqQZkItMM2rMx5/58YeFIdvDUpWFM9ByLkIaGXQITL5SKFJ+9k78 X-Received: by 2002:a17:906:4406:: with SMTP id x6mr5231542ejo.160.1586988103145; Wed, 15 Apr 2020 15:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586988103; cv=none; d=google.com; s=arc-20160816; b=WUBETVHWvSMFqSVn9PSV4Bcbr8llgwVV/R95uTYvoAY7EMBLU3Kx64upHmRUIRM45t UtcWdcZ7B8Vt3My/3RSb/RhZmS4Nfw1z9QQeQxTdsUnXCCiPSHuuyTTg++VsnXp9kXjT o4TrySzALmoOE2NLomf3WT6IG7vSNw0+s+fWe91Zj33ylxvolv+TTvyKAA7RdamYCksk okApIKsqXMJBEBNgWvmBo5OyKT/Q/tciHnUTI5qgZ4iq4VjP0wECfua+4E/e7lRhKK2J 9jquIbRfItSeQLgyfCsxNAbt121NJaQImpn8/jSxfj7FyQ/xW2t5NQZuqtuz9/xnn5i4 RN9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=uhT1gv4Qrtw1RL2Lo7HYOqgg9P+w3KjMp2aDIzNH6ZI=; b=CdwYgR4gujLL6X0ywmxz1wb4tidOXa57zGGBWKk+UPcsNenk5qQAebcZ8FtiBbPsh+ X58Q57TJC842MuRXPSCczNlqvP7FI7r4W+SNl6HJZsZxsdOm7ybjGVS8iZlu5H5U75BH H2DpiX2fCvq+1IC3wqMtTU3Rk4BPJOr02ADLP4+IhqnF/XtmJj1TNS/A1rm27IcJJoID vTmZMtw063wCP5pwbnBwZm5k0D+QZ6AXwmAEY9azYfNtZoCyxQER4DRddGsnztf6qaXs T8H3tmZz84Bw/fJALoUUMvSBQpT4n7NGcTftyI03xLkQIgAfO1Emqg7+rL/DdvS3AD4v M/xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi18si11634010edb.109.2020.04.15.15.01.19; Wed, 15 Apr 2020 15:01:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392500AbgDOBVN (ORCPT + 99 others); Tue, 14 Apr 2020 21:21:13 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:12034 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392479AbgDOBVK (ORCPT ); Tue, 14 Apr 2020 21:21:10 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app04-12004 (RichMail) with SMTP id 2ee45e966162f67-5b220; Wed, 15 Apr 2020 09:20:34 +0800 (CST) X-RM-TRANSID: 2ee45e966162f67-5b220 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from [172.20.21.224] (unknown[112.25.154.146]) by rmsmtp-syy-appsvr02-12002 (RichMail) with SMTP id 2ee25e9661610ba-4593e; Wed, 15 Apr 2020 09:20:33 +0800 (CST) X-RM-TRANSID: 2ee25e9661610ba-4593e Subject: Re: [PATCH] btrfs: Fix backref.c selftest compilation warning To: dsterba@suse.cz, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Shengju Zhang References: <20200411154915.9408-1-tangbin@cmss.chinamobile.com> <20200414151931.GU5920@twin.jikos.cz> <20200414152233.GV5920@twin.jikos.cz> From: Tang Bin Message-ID: Date: Wed, 15 Apr 2020 09:22:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200414152233.GV5920@twin.jikos.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David: On 2020/4/14 23:22, David Sterba wrote: > On Tue, Apr 14, 2020 at 05:19:31PM +0200, David Sterba wrote: >> On Sat, Apr 11, 2020 at 11:49:15PM +0800, Tang Bin wrote: >>> Fix missing braces compilation warning in the ARM >>> compiler environment: >>> fs/btrfs/backref.c: In function ‘is_shared_data_backref’: >>> fs/btrfs/backref.c:394:9: warning: missing braces around initializer [-Wmissing-braces] >>> struct prelim_ref target = {0}; >>> fs/btrfs/backref.c:394:9: warning: (near initialization for ‘target.rbnode’) [-Wmissing-braces] >>> >>> Signed-off-by: Tang Bin >>> Signed-off-by: Shengju Zhang >>> --- >>> fs/btrfs/backref.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c >>> index 9c380e7..0cc0257 100644 >>> --- a/fs/btrfs/backref.c >>> +++ b/fs/btrfs/backref.c >>> @@ -391,7 +391,7 @@ static int is_shared_data_backref(struct preftrees *preftrees, u64 bytenr) >>> struct rb_node **p = &preftrees->direct.root.rb_root.rb_node; >>> struct rb_node *parent = NULL; >>> struct prelim_ref *ref = NULL; >>> - struct prelim_ref target = {0}; >>> + struct prelim_ref target = {}; >> I wonder why this initialization is a problem while there are about 20 >> other uses of "{0}". The warning is about the embedded rbnode, but why >> does a more recent compiler not warn about that? Is this a missing fix >> from the one you use? >> >> I don't mind fixing compiler warnings as long as it bothers enough >> people, eg. we have fixes reported by gcc 7 but I'm hesitant to fix >> anything older without a good reason. > This seems to be the bug report > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 > "Bug 53119 - -Wmissing-braces wrongly warns about universal zero > initializer {0} " Thank you for your reply. My tool chain is "arm-linux-gnueabihf-gcc(Linaro GCC 4.9-2017.01) 4.9.4". I was trying to do an experiment on the hardware so I compiled it and there was a warning. Maybe as Qu Wenruo said possible tools are old? Thank you for your patience, Tang Bin