From: "mark at klomp dot org" <sourceware-bugzilla@sourceware.org>
To: bzip2-devel@sourceware.org
Subject: [Bug bzip2/28904] libbzip2: ‘cost[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Date: Thu, 26 May 2022 20:53:44 +0000 [thread overview]
Message-ID: <bug-28904-11876-xMF9aPNlkb@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28904-11876@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=28904
Mark Wielaard <mark at klomp dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #4 from Mark Wielaard <mark at klomp dot org> ---
(In reply to demerphq from comment #3)
> I am fine with both of your proposals. I was wondering why you don't
> use memset() instead of the explicit loop? From what I understand it
> is faster.
I went with the second option. I am not using memset but let the compiler pick
the most efficient way of initializing. With just 6 elements calling memcpy
might just be extra overhead. Thanks for the report.
commit 9de658d248f9fd304afa3321dd7a9de1280356ec
Author: Mark Wielaard <mark@klomp.org>
Date: Thu May 26 22:38:01 2022 +0200
Initialize the fave and cost arrays fully
We try to be smart in sendMTFValues by initializing just nGroups
number of elements instead of all BZ_N_GROUPS elements. But this means
the compiler doesn't know all elements are correctly initialized and
might warn. The arrays are really small, BZ_N_GROUPS, 6 elements. And
nGroups == BZ_N_GROUPS is the common case. So just initialize them all
always. Using a constant loop might also help the compiler to optimize
the initialization.
https://sourceware.org/bugzilla/show_bug.cgi?id=28904
--
You are receiving this mail because:
You are on the CC list for the bug.
next prev parent reply other threads:[~2022-05-26 20:53 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 [this message]
2022-05-31 19:06 ` email at arsoftware dot net.br
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=bug-28904-11876-xMF9aPNlkb@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=bzip2-devel@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).