public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Austin Kim <austindh.kim@gmail.com>
Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix Wmaybe-uninitialized warning
Date: Tue, 17 Sep 2019 12:12:23 +0200	[thread overview]
Message-ID: <20190917101223.GQ2850@twin.jikos.cz> (raw)
In-Reply-To: <20190903033019.GA149622@LGEARND20B15>

On Tue, Sep 03, 2019 at 12:30:19PM +0900, Austin Kim wrote:
> gcc throws warning message as below:

What version of gcc reports that? 9.2.1 does not.

> ‘clone_src_i_size’ may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>  #define IS_ALIGNED(x, a)  (((x) & ((typeof(x))(a) - 1)) == 0)
>                        ^
> fs/btrfs/send.c:5088:6: note: ‘clone_src_i_size’ was declared here
>  u64 clone_src_i_size;
>    ^
> The clone_src_i_size is only used as call-by-reference
> in a call to get_inode_info().

The reference is passed to a static function, so the compiler has enough
information to determine if it's unused. By inspection I don't see a
problem with the uninitalized variable: if __get_inode_info succeeds,
there's a valid value, in error case it's not used at all.

  parent reply	other threads:[~2019-09-17 10:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03  3:30 [PATCH] btrfs: fix Wmaybe-uninitialized warning Austin Kim
2019-09-10 16:39 ` Austin Kim
2019-09-17 10:12 ` David Sterba [this message]
2019-10-07 15:03 ` 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=20190917101223.GQ2850@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=austindh.kim@gmail.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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