From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id BBC573857BB6 for ; Mon, 4 Jul 2022 13:05:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BBC573857BB6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 99D46302AB2C for ; Mon, 4 Jul 2022 15:05:36 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 33690404AC7E; Mon, 4 Jul 2022 15:05:36 +0200 (CEST) Message-ID: Subject: Re: [PATCH] Always assign svalue when checking and reporting negative values From: Mark Wielaard To: dwz@sourceware.org Date: Mon, 04 Jul 2022 15:05:35 +0200 In-Reply-To: <20220630124208.22881-1-mark@klomp.org> References: <20220630124208.22881-1-mark@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2022 13:05:38 -0000 Hi, On Thu, 2022-06-30 at 14:42 +0200, Mark Wielaard wrote: > GCC12 warns: >=20 > In file included from /usr/include/error.h:59, > from dwz.c:23: > In function =E2=80=98error=E2=80=99, > inlined from =E2=80=98checksum_die=E2=80=99 at dwz.c:3364:7: > /usr/include/bits/error.h:42:5: warning: =E2=80=98svalue=E2=80=99 may be = used > uninitialized [-Wmaybe-uninitialized] > 42 | __error_alias (__status, __errnum, __format, __va_arg_pack > ()); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~ > dwz.c: In function =E2=80=98checksum_die=E2=80=99: > dwz.c:3354:25: note: =E2=80=98svalue=E2=80=99 was declared here > 3354 | int64_t svalue =3D read_sleb128 (ptr); > | ^~~~~~ >=20 > It is correct. We jump to the common error reporting label negative > where we expect svalue to be set so we can print it in the error > message. But it isn't in all places. Fix this by explicitly assigning > svalue first in all places we goto negative on failure. >=20 > * dwz.c (checksum_die): Always assign svalue when > checking and reporting on unexpected negative values. I pushed this one. Cheers, Mark