[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190917101223.GQ2850@twin.jikos.cz>
Date: Tue, 17 Sep 2019 12:12:23 +0200
From: David Sterba <dsterba@...e.cz>
To: Austin Kim <austindh.kim@...il.com>
Cc: clm@...com, josef@...icpanda.com, dsterba@...e.com,
linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: fix Wmaybe-uninitialized warning
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.
Powered by blists - more mailing lists