From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: Arnd Bergmann <arnd@arndb.de>, Dave Kleikamp <shaggy@kernel.org>
Cc: clang-built-linux@googlegroups.com,
Nick Desaulniers <ndesaulniers@google.com>,
Nathan Chancellor <natechancellor@gmail.com>,
jfs-discussion@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] jfs: fix bogus variable self-initialization
Date: Fri, 22 Mar 2019 09:41:21 -0500 [thread overview]
Message-ID: <85746d06-fdf9-6438-17f6-06d65608e2ac@oracle.com> (raw)
In-Reply-To: <20190322141922.691391-1-arnd@arndb.de>
On 3/22/19 9:19 AM, Arnd Bergmann wrote:
> A statement was originally added in 2006 to shut up a gcc warning,
> now but now clang warns about it:
>
> fs/jfs/jfs_txnmgr.c:1932:15: error: variable 'pxd' is uninitialized when used within its own initialization
> [-Werror,-Wuninitialized]
> pxd_t pxd = pxd; /* truncated extent of xad */
> ~~~ ^~~
>
> Modern versions of gcc are fine without the silly assignment, so just
> drop it. Tested with gcc-4.6 (released 2011), 4.7, 4.8, and 4.9.
Thanks Arnd. Will push it upstream.
Shaggy
>
> Fixes: c9e3ad6021e5 ("JFS: Get rid of "may be used uninitialized" warnings")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> ---
> fs/jfs/jfs_txnmgr.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
> index a5663cb621d8..78789c5ed36b 100644
> --- a/fs/jfs/jfs_txnmgr.c
> +++ b/fs/jfs/jfs_txnmgr.c
> @@ -1928,8 +1928,7 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
> * header ?
> */
> if (tlck->type & tlckTRUNCATE) {
> - /* This odd declaration suppresses a bogus gcc warning */
> - pxd_t pxd = pxd; /* truncated extent of xad */
> + pxd_t pxd; /* truncated extent of xad */
> int twm;
>
> /*
>
prev parent reply other threads:[~2019-03-22 14:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-22 14:19 Arnd Bergmann
2019-03-22 14:41 ` Dave Kleikamp [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=85746d06-fdf9-6438-17f6-06d65608e2ac@oracle.com \
--to=dave.kleikamp@oracle.com \
--cc=arnd@arndb.de \
--cc=clang-built-linux@googlegroups.com \
--cc=jfs-discussion@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=shaggy@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
all inboxes | Powered by JetHome®