public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: dwz@sourceware.org
Subject: Re: [PATCH] Always assign svalue when checking and reporting negative values
Date: Mon, 04 Jul 2022 15:05:35 +0200	[thread overview]
Message-ID: <fb4d9c60bcd2b519a5f24136017d5c6c4827fdfd.camel@klomp.org> (raw)
In-Reply-To: <20220630124208.22881-1-mark@klomp.org>

Hi,

On Thu, 2022-06-30 at 14:42 +0200, Mark Wielaard wrote:
> GCC12 warns:
> 
> In file included from /usr/include/error.h:59,
>                  from dwz.c:23:
> In function ‘error’,
>     inlined from ‘checksum_die’ at dwz.c:3364:7:
> /usr/include/bits/error.h:42:5: warning: ‘svalue’ may be used
>    uninitialized [-Wmaybe-uninitialized]
>    42 |  __error_alias (__status, __errnum, __format, __va_arg_pack
> ());
>       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~
> dwz.c: In function ‘checksum_die’:
> dwz.c:3354:25: note: ‘svalue’ was declared here
>  3354 |                 int64_t svalue = read_sleb128 (ptr);
>       |                         ^~~~~~
> 
> 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.
> 
> 	* dwz.c (checksum_die): Always assign svalue when
> 	checking and reporting on unexpected negative values.

I pushed this one.

Cheers,

Mark

      reply	other threads:[~2022-07-04 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 12:42 Mark Wielaard
2022-07-04 13:05 ` Mark Wielaard [this message]

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=fb4d9c60bcd2b519a5f24136017d5c6c4827fdfd.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=dwz@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).