From: Michael Petlan <mpetlan@redhat.com>
To: linux-trace-devel@vger.kernel.org
Cc: rostedt@goodmis.org
Subject: [PATCH 1/3] libtraceevent: Fix uninitialized has_0x compiler warning
Date: Fri, 30 Sep 2022 13:10:00 +0200 [thread overview]
Message-ID: <20220930111002.6107-2-mpetlan@redhat.com> (raw)
In-Reply-To: <20220930111002.6107-1-mpetlan@redhat.com>
Initialize has_0x in order to supress the following compiler warning:
event-parse.c:5654:20: warning: 'has_0x' may be used uninitialized in this function [-Wmaybe-uninitialized]
5654 | if (has_0x)
| ^
event-parse.c:5619:14: note: 'has_0x' was declared here
5619 | bool has_0x;
| ^~~~~~
Signed-off-by: Michael Petlan <mpetlan@redhat.com>
---
src/event-parse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/event-parse.c b/src/event-parse.c
index 980e980..edf990a 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -5657,7 +5657,7 @@ static inline void print_field(struct trace_seq *s, void *data, int size,
struct tep_print_parse *start_parse;
struct tep_print_parse *parse;
struct tep_print_arg *arg;
- bool has_0x;
+ bool has_0x = false;
parse = parse_ptr ? *parse_ptr : event->print_fmt.print_cache;
--
2.18.4
next prev parent reply other threads:[~2022-09-30 11:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-30 11:09 [PATCH 0/3] Fix several Coverity andf Clang warnings in libtraceevent Michael Petlan
2022-09-30 11:10 ` Michael Petlan [this message]
2022-09-30 11:10 ` [PATCH 2/3] libtraceevent: Fix check-after-deref coverity flaw Michael Petlan
2022-09-30 11:10 ` [PATCH 3/3] libtraceevent: Fix Branch condition garbage value compiler warning Michael Petlan
2022-10-20 19:15 ` [PATCH 0/3] Fix several Coverity andf Clang warnings in libtraceevent Steven Rostedt
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=20220930111002.6107-2-mpetlan@redhat.com \
--to=mpetlan@redhat.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.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).