-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Issue #4 - Silence uninitialized warnings #5
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since cost is not initialized and the compiler cannot tell if they are properly initialized (they are) warnings are produced when building in blead perl under certain compilers. This patch silences the warnings by making sure the data structures are initialized to 0. Warnings silenced: 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=64 -Wall -Werror=pointer-arith -Werror=vla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -O3 -DVERSION=\"2.101\" -DXS_VERSION=\"2.101\" -fPIC "-I../.." -Wall -Wno-comment -DBZ_NO_STDIO compress.c compress.c: In function ‘BZ2_compressBlock’: compress.c:392:54: warning: ‘cost[5]’ may be used uninitialized in this function [-Wmaybe-uninitialized] for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv]; ^~ compress.c:256:11: note: ‘cost[5]’ was declared here UInt16 cost[BZ_N_GROUPS]; ^~~~ compress.c:402:21: warning: ‘cost[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (cost[t] < bc) { bc = cost[t]; bt = t; }; ~~~~^~~ compress.c:256:11: note: ‘cost[3]’ was declared here UInt16 cost[BZ_N_GROUPS]; ^~~~ compress.c:402:21: warning: ‘cost[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (cost[t] < bc) { bc = cost[t]; bt = t; }; ~~~~^~~ compress.c:256:11: note: ‘cost[2]’ was declared here UInt16 cost[BZ_N_GROUPS]; ^~~~
I have filed a ticket with the upstream library maintainer |
jkeenan
pushed a commit
to Perl/perl5
that referenced
this pull request
Apr 6, 2022
This commit synchs into blead versions 2.103 for 3 CPAN distributions: Compress-Raw-Zlib IO-Compress Compress-Raw-Bzip2 Applying the commits one at a time would have resulted in one test failure in one of those commits, but applying all three has all tests passing as expected From Changes for Compress-Raw-Zlib 2.103 3 April 2022 * Sync upstream fix for CVE-2018-25032 GHSA-jc36-42cf-vqwj Update to Zlib 1.2.12 d507f527768f6cbab5831ed3ec17fe741163785c Fix for inflateSync return code change f47ea5f36c40fe19efe404dd75fd790b115de596 Fix for incorrect CRC from zlib 1.2.12.1 madler/zlib@ec3df00 60104e3a162a116548303861ae0811fb850e65fd * AUTHOR doesn't contain the stated information bf5a03c1b440c8d9e41cffb344bf889794cc532b From Changes for IO-Compress 2.103 3 April 2022 * Update version to 2.103 97f1893892eccac69b3a8033378b0b44d7c4f3ab * Fix for inflateSyncs retrurn code change 4843e22285bf8e52c9b5b913d167a1545995c793 * Add constant for ZIP_CM_AES 91be04dd8dc2848e3c25b87ec498cf8ccc34187a * Point links to rfcs to ietf.org pmqs/IO-Compress#37 a8f28b36cf4d77df1cfa0516867012425920a62f * Rename test file to fix manifest warning pmqs/IO-Compress#36 955244f9ac0654d7e8d54115162da53c85d7178c * Add perl 5.34 06f41883f62ed1b88b03c246b16e0b5ef72503bc * Fix for Calling nextStream on an IO::Uncompress::Zip object in Transparent mode dies when input is uncompressed pmqs/IO-Compress#34 b0f93fe62f84b7d4d4bb8d2ea8e6d5432887103f * IO::Compress: Generalize for EBCDIC pmqs/IO-Compress#32 90b51dbbd785e2c824cb0a93feef3b3dd5d075f2 * IO::Compress: Fix misspelling in 112utf8-zip.t c22216b5d3202dce01ef17a271252f82520a6ab9 * Revert "Always have full zip64 entry in central directory" 7df4c9bc98667bc1afd1b4bc5a27d20f94e3cd9c * Always have full zip64 entry in central directory 333648ee1dece6eb220060c7ec09806f6ebb9866 * update cpanm path on MacOS 33079902934885c515768a08d72e89243a5d01a9 From Changes for Compress-Raw-Bzip2 2.103 3 April 2022 * Silence uninitialized warnings pmqs/Compress-Raw-Bzip2#5 ff3d907325091287ac1525db384b99a968d763d7 641a440ec6229c1d368b9ead48f4968b955c0115
jkeenan
pushed a commit
to Perl/perl5
that referenced
this pull request
Apr 7, 2022
This commit synchs into blead versions 2.103 for 3 CPAN distributions: Compress-Raw-Zlib IO-Compress Compress-Raw-Bzip2 Applying the commits one at a time would have resulted in one test failure in one of those commits, but applying all three has all tests passing as expected From Changes for Compress-Raw-Zlib 2.103 3 April 2022 * Sync upstream fix for CVE-2018-25032 GHSA-jc36-42cf-vqwj Update to Zlib 1.2.12 d507f527768f6cbab5831ed3ec17fe741163785c Fix for inflateSync return code change f47ea5f36c40fe19efe404dd75fd790b115de596 Fix for incorrect CRC from zlib 1.2.12.1 madler/zlib@ec3df00 60104e3a162a116548303861ae0811fb850e65fd * AUTHOR doesn't contain the stated information bf5a03c1b440c8d9e41cffb344bf889794cc532b From Changes for IO-Compress 2.103 3 April 2022 * Update version to 2.103 97f1893892eccac69b3a8033378b0b44d7c4f3ab * Fix for inflateSyncs retrurn code change 4843e22285bf8e52c9b5b913d167a1545995c793 * Add constant for ZIP_CM_AES 91be04dd8dc2848e3c25b87ec498cf8ccc34187a * Point links to rfcs to ietf.org pmqs/IO-Compress#37 a8f28b36cf4d77df1cfa0516867012425920a62f * Rename test file to fix manifest warning pmqs/IO-Compress#36 955244f9ac0654d7e8d54115162da53c85d7178c * Add perl 5.34 06f41883f62ed1b88b03c246b16e0b5ef72503bc * Fix for Calling nextStream on an IO::Uncompress::Zip object in Transparent mode dies when input is uncompressed pmqs/IO-Compress#34 b0f93fe62f84b7d4d4bb8d2ea8e6d5432887103f * IO::Compress: Generalize for EBCDIC pmqs/IO-Compress#32 90b51dbbd785e2c824cb0a93feef3b3dd5d075f2 * IO::Compress: Fix misspelling in 112utf8-zip.t c22216b5d3202dce01ef17a271252f82520a6ab9 * Revert "Always have full zip64 entry in central directory" 7df4c9bc98667bc1afd1b4bc5a27d20f94e3cd9c * Always have full zip64 entry in central directory 333648ee1dece6eb220060c7ec09806f6ebb9866 * update cpanm path on MacOS 33079902934885c515768a08d72e89243a5d01a9 From Changes for Compress-Raw-Bzip2 2.103 3 April 2022 * Silence uninitialized warnings pmqs/Compress-Raw-Bzip2#5 ff3d907325091287ac1525db384b99a968d763d7 641a440ec6229c1d368b9ead48f4968b955c0115
kraj
pushed a commit
to YoeDistro/meta-openembedded
that referenced
this pull request
Nov 2, 2022
https://metacpan.org/dist/Compress-Raw-Bzip2/changes License-Update: Update copyright years. 2.201 25 June 2022 * 2.201 Sat Jun 25 08:46:32 2022 +0100 92a318bb03b85e2dcb4991f4b958fbce6ce9913f * Add perl 5.36 Sun Jun 5 13:45:55 2022 +0100 23064d78dcd14f0898aeb64ce408914dac0805a0 * 2.103 3 April 2022 * Silence uninitialized warnings pmqs/Compress-Raw-Bzip2#5 ff3d907325091287ac1525db384b99a968d763d7 641a440ec6229c1d368b9ead48f4968b955c0115 * 2.101 20 February 2021 * fix version numbers in meta files * 2.100 7 January 2021 * trim whitespace f5bb5c5d254f2a9ac6c6e67a5a4823d0f67e7ecb Signed-off-by: Tim Orling <[email protected]> Signed-off-by: Khem Raj <[email protected]>
kraj
pushed a commit
to YoeDistro/meta-openembedded
that referenced
this pull request
Nov 2, 2022
https://metacpan.org/dist/Compress-Raw-Bzip2/changes License-Update: Update copyright years. 2.201 25 June 2022 * 2.201 Sat Jun 25 08:46:32 2022 +0100 92a318bb03b85e2dcb4991f4b958fbce6ce9913f * Add perl 5.36 Sun Jun 5 13:45:55 2022 +0100 23064d78dcd14f0898aeb64ce408914dac0805a0 * 2.103 3 April 2022 * Silence uninitialized warnings pmqs/Compress-Raw-Bzip2#5 ff3d907325091287ac1525db384b99a968d763d7 641a440ec6229c1d368b9ead48f4968b955c0115 * 2.101 20 February 2021 * fix version numbers in meta files * 2.100 7 January 2021 * trim whitespace f5bb5c5d254f2a9ac6c6e67a5a4823d0f67e7ecb Signed-off-by: Tim Orling <[email protected]> Signed-off-by: Khem Raj <[email protected]>
scottchiefbaker
pushed a commit
to scottchiefbaker/perl5
that referenced
this pull request
Nov 3, 2022
This commit synchs into blead versions 2.103 for 3 CPAN distributions: Compress-Raw-Zlib IO-Compress Compress-Raw-Bzip2 Applying the commits one at a time would have resulted in one test failure in one of those commits, but applying all three has all tests passing as expected From Changes for Compress-Raw-Zlib 2.103 3 April 2022 * Sync upstream fix for CVE-2018-25032 GHSA-jc36-42cf-vqwj Update to Zlib 1.2.12 d507f527768f6cbab5831ed3ec17fe741163785c Fix for inflateSync return code change f47ea5f36c40fe19efe404dd75fd790b115de596 Fix for incorrect CRC from zlib 1.2.12.1 madler/zlib@ec3df00 60104e3a162a116548303861ae0811fb850e65fd * AUTHOR doesn't contain the stated information bf5a03c1b440c8d9e41cffb344bf889794cc532b From Changes for IO-Compress 2.103 3 April 2022 * Update version to 2.103 97f1893892eccac69b3a8033378b0b44d7c4f3ab * Fix for inflateSyncs retrurn code change 4843e22285bf8e52c9b5b913d167a1545995c793 * Add constant for ZIP_CM_AES 91be04dd8dc2848e3c25b87ec498cf8ccc34187a * Point links to rfcs to ietf.org pmqs/IO-Compress#37 a8f28b36cf4d77df1cfa0516867012425920a62f * Rename test file to fix manifest warning pmqs/IO-Compress#36 955244f9ac0654d7e8d54115162da53c85d7178c * Add perl 5.34 06f41883f62ed1b88b03c246b16e0b5ef72503bc * Fix for Calling nextStream on an IO::Uncompress::Zip object in Transparent mode dies when input is uncompressed pmqs/IO-Compress#34 b0f93fe62f84b7d4d4bb8d2ea8e6d5432887103f * IO::Compress: Generalize for EBCDIC pmqs/IO-Compress#32 90b51dbbd785e2c824cb0a93feef3b3dd5d075f2 * IO::Compress: Fix misspelling in 112utf8-zip.t c22216b5d3202dce01ef17a271252f82520a6ab9 * Revert "Always have full zip64 entry in central directory" 7df4c9bc98667bc1afd1b4bc5a27d20f94e3cd9c * Always have full zip64 entry in central directory 333648ee1dece6eb220060c7ec09806f6ebb9866 * update cpanm path on MacOS 33079902934885c515768a08d72e89243a5d01a9 From Changes for Compress-Raw-Bzip2 2.103 3 April 2022 * Silence uninitialized warnings pmqs/Compress-Raw-Bzip2#5 ff3d907325091287ac1525db384b99a968d763d7 641a440ec6229c1d368b9ead48f4968b955c0115
kraj
pushed a commit
to YoeDistro/meta-openembedded
that referenced
this pull request
Nov 7, 2022
https://metacpan.org/dist/Compress-Raw-Bzip2/changes License-Update: Update copyright years. 2.201 25 June 2022 * 2.201 Sat Jun 25 08:46:32 2022 +0100 92a318bb03b85e2dcb4991f4b958fbce6ce9913f * Add perl 5.36 Sun Jun 5 13:45:55 2022 +0100 23064d78dcd14f0898aeb64ce408914dac0805a0 * 2.103 3 April 2022 * Silence uninitialized warnings pmqs/Compress-Raw-Bzip2#5 ff3d907325091287ac1525db384b99a968d763d7 641a440ec6229c1d368b9ead48f4968b955c0115 * 2.101 20 February 2021 * fix version numbers in meta files * 2.100 7 January 2021 * trim whitespace f5bb5c5d254f2a9ac6c6e67a5a4823d0f67e7ecb Signed-off-by: Tim Orling <[email protected]> Signed-off-by: Khem Raj <[email protected]>
daregit
pushed a commit
to daregit/yocto-combined
that referenced
this pull request
May 22, 2024
https://metacpan.org/dist/Compress-Raw-Bzip2/changes License-Update: Update copyright years. 2.201 25 June 2022 * 2.201 Sat Jun 25 08:46:32 2022 +0100 92a318bb03b85e2dcb4991f4b958fbce6ce9913f * Add perl 5.36 Sun Jun 5 13:45:55 2022 +0100 23064d78dcd14f0898aeb64ce408914dac0805a0 * 2.103 3 April 2022 * Silence uninitialized warnings pmqs/Compress-Raw-Bzip2#5 ff3d907325091287ac1525db384b99a968d763d7 641a440ec6229c1d368b9ead48f4968b955c0115 * 2.101 20 February 2021 * fix version numbers in meta files * 2.100 7 January 2021 * trim whitespace f5bb5c5d254f2a9ac6c6e67a5a4823d0f67e7ecb Signed-off-by: Tim Orling <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since cost is not initialized and the compiler cannot tell
if they are properly initialized (they are) warnings are produced
when building in blead perl under certain compilers.
This patch silences the warnings by making sure the data structures
are initialized to 0.
Warnings silenced: