linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Hesse <mail@eworm.de>
To: linux-btrfs@vger.kernel.org
Cc: Christian Hesse <mail@eworm.de>
Subject: [PATCH 1/1] btrfs-progs: fix compiler warning
Date: Thu,  5 Jun 2014 10:13:39 +0200	[thread overview]
Message-ID: <1401956019-2175-1-git-send-email-mail@eworm.de> (raw)

gcc 4.9.0 gives warnings about possibly uninitialized values when
compiling with function inlining and optimization level two enabled
(CFLAGS="-finline-functions -O2").

Initializing the values fixes the warning. Hope this is correct.

Signed-off-by: Christian Hesse <mail@eworm.de>
---
 cmds-send.c   | 2 +-
 send-stream.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmds-send.c b/cmds-send.c
index 1cd457d..0c3e96b 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -416,7 +416,7 @@ int cmd_send(int argc, char **argv)
 	u32 i;
 	char *mount_root = NULL;
 	char *snapshot_parent = NULL;
-	u64 root_id;
+	u64 root_id = 0;
 	u64 parent_root_id = 0;
 	int full_send = 1;
 	int new_end_cmd_semantic = 0;
diff --git a/send-stream.c b/send-stream.c
index 88e18e2..54edafe 100644
--- a/send-stream.c
+++ b/send-stream.c
@@ -216,7 +216,7 @@ static int tlv_get_string(struct btrfs_send_stream *s, int attr, char **str)
 {
 	int ret;
 	void *data;
-	int len;
+	int len = 0;
 
 	TLV_GET(s, attr, &data, &len);
 
-- 
2.0.0


             reply	other threads:[~2014-06-05  8:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05  8:13 Christian Hesse [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-06-03 11:37 [PATCH 1/1] btrfs-progs: fix compiler warning Christian Hesse
2014-06-03 11:29 Christian Hesse
2014-06-03 16:52 ` David Sterba
2014-06-03 18:04   ` Christian Hesse
2014-06-04  6:48 ` Qu Wenruo
2014-06-04  7:19   ` Christian Hesse
2014-06-04 16:44     ` David Sterba
2014-06-05  8:59       ` Christian Hesse
2014-06-10 11:05         ` 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=1401956019-2175-1-git-send-email-mail@eworm.de \
    --to=mail@eworm.de \
    --cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).