public inbox for
 help / color / mirror / Atom feed
From: "email at arsoftware dot" <>
Subject: [Bug bzip2/28904] libbzip2: ‘cost[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Date: Tue, 31 May 2022 19:06:56 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

--- Comment #5 from email at arsoftware dot ---
   Need to check the code
   Em 19 de abr. de 2022 19:04, mark at klomp dot org via Bzip2-devel
   <> escreveu:

     Mark Wielaard <mark at klomp dot org> changed:

     What |Removed |Added
     Last reconfirmed| |2022-04-19
     Ever confirmed|0 |1
     CC| |mark at klomp dot org

     --- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
     Sorry for the late reply.

     I think you are right that initializing these two small (6 ints)
     arrays at the
     start of the function is fine if it helps the compiler.

     I haven't been able to reproduce the compiler warning myself
     My proposed patch would be:

     diff --git a/compress.c b/compress.c
     index 5dfa002..c825c78 100644
     --- a/compress.c
     +++ b/compress.c
     @@ -253,8 +253,8 @@ void sendMTFValues ( EState* s )

     - UInt16 cost[BZ_N_GROUPS];
     - Int32 fave[BZ_N_GROUPS];
     + UInt16 cost[BZ_N_GROUPS] = { 0 };
     + Int32 fave[BZ_N_GROUPS] = { 0 };

     UInt16* mtfv = s->mtfv;

     { 0 } initializes the whole array with zero, so we don't have to
     know the exact
     number of elements.

     Does the above work for you?

     You are receiving this mail because:
     You are on the CC list for the bug.

You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2022-05-31 19:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18  3:18 [Bug bzip2/28904] New: " demerphq at gmail dot com
2022-04-19 22:04 ` [Bug bzip2/28904] " mark at klomp dot org
2022-04-19 22:23 ` mark at klomp dot org
2022-04-20  1:57 ` demerphq at gmail dot com
2022-05-26 20:53 ` mark at klomp dot org
2022-05-31 19:06 ` email at arsoftware dot [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* 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).