public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "Michał Kotyla" <michal.kotyla@3mdeb.com>
To: systemtap@sourceware.org
Cc: piotr.krol@3mdeb.com, tomasz.zyjewski@3mdeb.com
Subject: [PATCH] Fix uninitialized variables
Date: Mon, 8 Nov 2021 12:18:18 +0100	[thread overview]
Message-ID: <a564dbe2-a977-092b-c813-667453d3129f@3mdeb.com> (raw)

Hello,

in Yocto or any other build system which uses 
"-Werror=maybe-uninitialized" flag, there is a problem while SystemTap 
is building. Initialization "this_column_size" and "num" variables as 
bellow fix this problem.

 From efca812046fa43ba778ebb4b065325b63b9c2b78 Mon Sep 17 00:00:00 2001 
From: =?UTF-8?q?Micha=C5=82=20Kotyla?= <michal.kotyla@3mdeb.com> Date: 
Mon, 8 Nov 2021 10:06:15 +0100 Subject: [PATCH] bpf-translate.cxx: 
Initialize variables 'num' and 'this_column_size' MIME-Version: 1.0 
Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 
Signed-off-by: Michał Kotyla <michal.kotyla@3mdeb.com> --- 
bpf-translate.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 
deletions(-) diff --git a/bpf-translate.cxx b/bpf-translate.cxx index 
3f45c721f..956f09d00 100644 --- a/bpf-translate.cxx +++ 
b/bpf-translate.cxx @@ -1203,7 +1203,7 @@ bpf_unparser::emit_asm_arg 
(const asm_stmt &stmt, const std::string &arg, { /* arg is a register 
number */ std::string reg = arg[0] == 'r' ? arg.substr(1) : arg; - 
unsigned long num; + unsigned long num = 0; bool parsed = false; try { 
num = stoul(reg, 0, 0); @@ -1943,7 +1943,7 @@ 
bpf_unparser::visit_foreach_loop(foreach_loop* s) auto type = 
arraydecl->index_types[k]; if (type != pe_long && type != pe_string) 
throw SEMANTIC_ERROR(_("unhandled foreach index type"), s->tok); - int 
this_column_size; + int this_column_size = 0; // PR23875: foreach should 
handle string keys if (type == pe_long) { -- 2.25.1

Best regards,

-- 
Michał Kotyla
Embedded Linux Developer
GPG: 14FC54DC259CF70A
https://3mdeb.com | @3mdeb_com


                 reply	other threads:[~2021-11-08 11:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=a564dbe2-a977-092b-c813-667453d3129f@3mdeb.com \
    --to=michal.kotyla@3mdeb.com \
    --cc=piotr.krol@3mdeb.com \
    --cc=systemtap@sourceware.org \
    --cc=tomasz.zyjewski@3mdeb.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).