linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	Anand Jain <anand.jain@oracle.com>,
	Filipe Manana <FdManana@suse.com>,
	Nikolay Borisov <nborisov@suse.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: shut up bogus -Wmaybe-uninitialized warning
Date: Mon, 17 Jun 2019 14:32:02 +0200	[thread overview]
Message-ID: <20190617123202.GD19057@suse.cz> (raw)
In-Reply-To: <20190617110738.2085060-1-arnd@arndb.de>

On Mon, Jun 17, 2019 at 01:07:28PM +0200, Arnd Bergmann wrote:
> gcc sometimes can't determine whether a variable has been initialized
> when both the initialization and the use are conditional:
> 
> fs/btrfs/props.c: In function 'inherit_props':
> fs/btrfs/props.c:389:4: error: 'num_bytes' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>     btrfs_block_rsv_release(fs_info, trans->block_rsv,
> 
> This code is fine. Unfortunately, I cannot think of a good way to
> rephrase it in a way that makes gcc understand this, so I add
> a bogus initialization the way one should not.

Looks ok, patch added to devel queue, thanks.
> 
> Fixes: d7400ee1b476 ("btrfs: use the existing reserved items for our first prop for inheritance")

I'd rather not add the Fixes tag here as it's just a compilation warning
for some old unknown version of gcc. I've checked that 8.3.1 and 9.1.1
don't print the warning and I consider any other version to be up to the
user of such environment to apply fixups as needed, but not to let the
stable machinery pick it up.

      reply	other threads:[~2019-06-17 12:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 11:07 [PATCH] btrfs: shut up bogus -Wmaybe-uninitialized warning Arnd Bergmann
2019-06-17 12:32 ` David Sterba [this message]

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=20190617123202.GD19057@suse.cz \
    --to=dsterba@suse.cz \
    --cc=FdManana@suse.com \
    --cc=anand.jain@oracle.com \
    --cc=arnd@arndb.de \
    --cc=clm@fb.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nborisov@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;
as well as URLs for NNTP newsgroup(s).