From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from 17.mo581.mail-out.ovh.net (17.mo581.mail-out.ovh.net [188.165.35.227]) by sourceware.org (Postfix) with ESMTPS id E2E0C3858030 for ; Mon, 8 Nov 2021 11:18:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E2E0C3858030 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=3mdeb.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=3mdeb.com Received: from player788.ha.ovh.net (unknown [10.110.115.178]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id CAEBF23760 for ; Mon, 8 Nov 2021 11:18:22 +0000 (UTC) Received: from 3mdeb.com (85-222-117-222.dynamic.chello.pl [85.222.117.222]) (Authenticated sender: michal.kotyla@3mdeb.com) by player788.ha.ovh.net (Postfix) with ESMTPSA id 91A5D240C577F; Mon, 8 Nov 2021 11:18:19 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-95G00129b05e38-be0c-47f6-9bb0-bdc7cfecb69b, 31C4C8B081C885D16483DB3630788C48132E68C4) smtp.auth=michal.kotyla@3mdeb.com X-OVh-ClientIp: 85.222.117.222 From: =?UTF-8?Q?Micha=c5=82_Kotyla?= To: systemtap@sourceware.org Cc: piotr.krol@3mdeb.com, tomasz.zyjewski@3mdeb.com Subject: [PATCH] Fix uninitialized variables Message-ID: Date: Mon, 8 Nov 2021 12:18:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 Content-Language: en-US X-Ovh-Tracer-Id: 539869005496352502 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvuddruddvgddvhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvuffkffgfgggtsegrtderredtfeejnecuhfhrohhmpefoihgthhgrlhgpmfhothihlhgruceomhhitghhrghlrdhkohhthihlrgesfehmuggvsgdrtghomheqnecuggftrfgrthhtvghrnhepheekgfetudeugfejgefhkeduueefudejkeeuffdtjefgheehjefffeeifeehheffnecuffhomhgrihhnpeefmhguvggsrdgtohhmnecukfhppedtrddtrddtrddtpdekhedrvddvvddruddujedrvddvvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepphhlrgihvghrjeekkedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehmihgthhgrlhdrkhhothihlhgrseefmhguvggsrdgtohhmpdhrtghpthhtohepshihshhtvghmthgrphesshhouhhrtggvfigrrhgvrdhorhhg X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2021 11:18:26 -0000 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?= 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 --- 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