From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 84D633858001; Fri, 18 Feb 2022 03:18:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84D633858001 From: "demerphq at gmail dot com" To: bzip2-devel@sourceware.org Subject: =?UTF-8?B?W0J1ZyBiemlwMi8yODkwNF0gTmV3OiBsaWJiemlwMjog4oCYY29z?= =?UTF-8?B?dFszXeKAmSBtYXkgYmUgdXNlZCB1bmluaXRpYWxpemVkIGluIHRoaXMgZnVu?= =?UTF-8?B?Y3Rpb24gWy1XbWF5YmUtdW5pbml0aWFsaXplZF0=?= Date: Fri, 18 Feb 2022 03:18:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: bzip2 X-Bugzilla-Component: bzip2 X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: demerphq at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: nobody at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: bzip2-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bzip2-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2022 03:18:52 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28904 Bug ID: 28904 Summary: libbzip2: =E2=80=98cost[3]=E2=80=99 may be used uniniti= alized in this function [-Wmaybe-uninitialized] Product: bzip2 Version: unspecified Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: bzip2 Assignee: nobody at sourceware dot org Reporter: demerphq at gmail dot com CC: bzip2-devel at sourceware dot org Target Milestone: --- Hi, I am a contributor to the Perl project. https://github.com/Perl/perl5 We bundle your library libbzip2 via the perl Module Compress-Raw-Bzip2, whi= ch is hosted at: https://github.com/pmqs/Compress-Raw-Bzip2 We are trying to ensure our builds are warning clean, however when building this package your library produces "may be used uninitialized" warnings on = some compilers, you can see these warnings below.=20 While this is almost certainly a false positive warning, it is also trivial= to silence the warnings with essentially no performance hit by initializing the cost structure with 0's at the start. We have an open bug report for this for perl here: https://github.com/Perl/perl5/issues/19432 And an open bug report for this for the module here: https://github.com/pmqs/Compress-Raw-Bzip2/issues/4 And a patch for it here: https://github.com/pmqs/Compress-Raw-Bzip2/pull/5/commits/641a440ec6229c1d3= 68b9ead48f4968b955c0115 The maintainer of Compress-Raw-Bzip2 (on CC) is known to prefer not to apply changes to this library code that are not upstream. (A reasonable policy.) I was wondering if you could apply this patch, or something equivalent that would fix this so that the perl project could have warning free builds. Your library is the last module we ship that produces warnings during the build process. We target a wide range of compilers and try to keep our code as cl= ean as possible, and while again I accept that your code likely is not buggy as= you initialize it in a loop at line 357,=20 357: for (t =3D 0; t < nGroups; t++) cost[t] =3D 0; as far as I can tell nGroups is not a constant, and the compiler reasonably cannot be certain that all BZ_N_GROUPS entries in the array are initialized before use.=20=20 We in the perl development community would appreciate it if you would relea= se a patch that would silence these warnings for us. Then Paul could roll a new release of his module, and we in the Perl could then use that and be happy = with a completely warning free build. gcc -c -I. -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -Wall -Werror=3Dpointer-arith -Werror=3Dvla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -O3 -DVERSION=3D\"2.101\" -DXS_VERSION=3D\"2.101\" -fPIC "-I../.." -Wall -Wno-comment -DBZ_NO_STDIO compress.c compress.c: In function =E2=80=98BZ2_compressBlock=E2=80=99: compress.c:392:54: warning: =E2=80=98cost[5]=E2=80=99 may be used uninitial= ized in this function [-Wmaybe-uninitialized] for (t =3D 0; t < nGroups; t++) cost[t] +=3D s->len[t][icv]; ^~ compress.c:256:11: note: =E2=80=98cost[5]=E2=80=99 was declared here UInt16 cost[BZ_N_GROUPS]; ^~~~ compress.c:402:21: warning: =E2=80=98cost[3]=E2=80=99 may be used uninitial= ized in this function [-Wmaybe-uninitialized] if (cost[t] < bc) { bc =3D cost[t]; bt =3D t; }; ~~~~^~~ compress.c:256:11: note: =E2=80=98cost[3]=E2=80=99 was declared here UInt16 cost[BZ_N_GROUPS]; ^~~~ compress.c:402:21: warning: =E2=80=98cost[2]=E2=80=99 may be used uninitial= ized in this function [-Wmaybe-uninitialized] if (cost[t] < bc) { bc =3D cost[t]; bt =3D t; }; ~~~~^~~ compress.c:256:11: note: =E2=80=98cost[2]=E2=80=99 was declared here UInt16 cost[BZ_N_GROUPS]; ^~~~ Your consideration on this matter would be much appreciated.=20 Thank you very much for your time in producing this library, I personally h= ave made use of it many times in my career. cheers, Yves --=20 You are receiving this mail because: You are on the CC list for the bug.=