perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

clang-14 build-time-warnings in Compress::Raw::*

Open jkeenan opened this issue 2 years ago • 1 comments

The following 3 build-time warnings were generated using clang-14 as the compiler. This data is from Ubuntu Linux 22.04 LTS, but I've got similar from FreeBSD-13. These warnings were originally reported by @pmqs in https://github.com/Perl/perl5/issues/21288, but since that ticket was originally focused on warnings from locale.c which have now been cleared up, we've closed that ticket and moved the remaining warnings (which must be cleared up upstream on CPAN first) to this new ticket.

$ parse-build-warnings 7011724240.linux.unthreaded.clang-14.maketp.output.txt.gz File:  7011724240.linux.unthreaded.clang-14.maketp.output.txt.gz

[
  {
    char   => 17,
    group  => "Wunused-but-set-variable",
    line   => 376,
    source => "Bzip2.xs",
    text   => "variable 'flags' set but not used",
  },
  {
    char   => 11,
    group  => "Wunused-but-set-variable",
    line   => 765,
    source => "blocksort.c",
    text   => "variable 'numQSorted' set but not used",
  },
  {
    char   => 30,
    group  => "Wunused-but-set-variable",
    line   => 247,
    source => "compress.c",
    text   => "variable 'totc' set but not used",
  },
]

Output from make test_prep:

make[1]: Entering directory '/home/jkeenan/gitwork/perl/cpan/Compress-Raw-Bzip2'
Running Mkbootstrap for Bzip2 ()
chmod 644 "Bzip2.bs"
/home/jkeenan/gitwork/perl/cpan/Compress-Raw-Bzip2/../../miniperl "-I../../lib" -MExtUtils::Command::MM -e 'cp_nonempty' -- Bzip2.bs ../../lib/auto/Compress/Raw/Bzip2/Bzip2.bs 644
"../../miniperl" "-I../../lib" "../../lib/ExtUtils/xsubpp"  -typemap '/home/jkeenan/gitwork/perl/cpan/Compress-Raw-Bzip2/../../lib/ExtUtils/typemap' -typemap '/home/jkeenan/gitwork/perl/cpan/Compress-Raw-Bzip2/typemap'  Bzip2.xs > Bzip2.xsc
mv Bzip2.xsc Bzip2.c
clang-14 -c  -I. -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 -O2   -DVERSION=\"2.206\" -DXS_VERSION=\"2.206\" -fPIC "-I../.."  -DBZ_NO_STDIO  Bzip2.c
Bzip2.xs:376:17: warning: variable 'flags' set but not used [-Wunused-but-set-variable]
            int flags = 0 ;
                ^
1 warning generated.
clang-14 -c  -I. -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 -O2   -DVERSION=\"2.206\" -DXS_VERSION=\"2.206\" -fPIC "-I../.."  -DBZ_NO_STDIO  blocksort.c
blocksort.c:765:11: warning: variable 'numQSorted' set but not used [-Wunused-but-set-variable]
   Int32  numQSorted;
          ^
1 warning generated.
clang-14 -c  -I. -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 -O2   -DVERSION=\"2.206\" -DXS_VERSION=\"2.206\" -fPIC "-I../.."  -DBZ_NO_STDIO  bzlib.c
clang-14 -c  -I. -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 -O2   -DVERSION=\"2.206\" -DXS_VERSION=\"2.206\" -fPIC "-I../.."  -DBZ_NO_STDIO  compress.c
compress.c:247:30: warning: variable 'totc' set but not used [-Wunused-but-set-variable]
   Int32 v, t, i, j, gs, ge, totc, bt, bc, iter;
                             ^
1 warning generated.

jkeenan avatar Oct 04 '23 20:10 jkeenan

pmqs/Compress-Raw-Bzip2#15 addresses this, so it should be fixed in the next Compress-Raw-Bzip2 release.

haarg avatar Jun 10 '24 21:06 haarg

Compress-Raw-Bzip2 version 2.213 was released on August 28 2024, merged into blead the same day, and appeared in perl-5.41.3. These warnings are no longer appearing when I compile blead with either clang-14 or clang-18. Closing ticket.

jkeenan avatar Oct 31 '24 23:10 jkeenan