lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
From: <mingli.yu@windriver.com>
To: lttng-dev@lists.lttng.org
Subject: [babeltrace][PATCH] fs.c: initialize the other_entry variable
Date: Wed, 11 Mar 2020 21:25:26 +0800	[thread overview]
Message-ID: <1583933126-67509-1-git-send-email-mingli.yu@windriver.com> (raw)

From: Mingli Yu <mingli.yu@windriver.com>

Initialize the pointer other_entry to fix the below error:
| ../../../../../git/src/plugins/ctf/fs-src/fs.c: In function 'ds_index_insert_ds_index_entry_sorted':
| ../../../../../git/src/plugins/ctf/fs-src/fs.c:702:5: error: 'other_entry' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|  702 |    !ds_index_entries_equal(entry, other_entry)) {

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 src/plugins/ctf/fs-src/fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/ctf/fs-src/fs.c b/src/plugins/ctf/fs-src/fs.c
index e87523a..a6b5315 100644
--- a/src/plugins/ctf/fs-src/fs.c
+++ b/src/plugins/ctf/fs-src/fs.c
@@ -680,7 +680,7 @@ void ds_index_insert_ds_index_entry_sorted(
 	struct ctf_fs_ds_index_entry *entry)
 {
 	guint i;
-	struct ctf_fs_ds_index_entry *other_entry;
+	struct ctf_fs_ds_index_entry *other_entry = NULL;
 
 	/* Find the spot where to insert this index entry. */
 	for (i = 0; i < index->entries->len; i++) {
-- 
2.7.4

             reply	other threads:[~2020-03-11 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 13:25 mingli.yu [this message]
2020-03-11 13:39 mingli.yu
2020-03-11 13:52 ` Simon Marchi
2020-03-12  3:37   ` Yu, Mingli via lttng-dev
2020-03-11 13:58 ` Mathieu Desnoyers

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=1583933126-67509-1-git-send-email-mingli.yu@windriver.com \
    --to=mingli.yu@windriver.com \
    --cc=lttng-dev@lists.lttng.org \
    --subject='Re: [babeltrace][PATCH] fs.c: initialize the other_entry variable' \
    /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

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).