Closed jmarshall closed 6 years ago
How do you get the warnings you mention? For me, XS compiles without any.
Yeah, I noticed that travis doesn't get them either. I must have -Wall
turned on somehow, will check. I'm not that excited about adding casts in general…
I agree. You probably have $CXX set with some extra include flag?!
Do you want me to close this? I wouldn't throw away the other improvements.
It turns out this is coming from the CentOS 6 base Perl installation. The XS modules are compiled and linked (via ExtUtils::CBuilder I guess) using Perl's configured-in optimize
and lddlflags
settings.
On the CentOS 6 system Perl 5.10.1 installation, these include -Wall
:
$ perl -V | grep -- -Wall
config_args='… -Wall …'
optimize='… -Wall …'
cccdlflags='…', lddlflags='… -Wall …'
$ perl -V:optimize
optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic';
It's similar on the up-to-date Centos 7.4 system Perl 5.16.3 — it's built with -Wall
in this burnt-in config setting:
centos7$ perl -V:optimize
optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic';
So anybody building Bio::DB::HTS on CentOS will see these warnings.
Some changes to Build.PL so that it will recognise HTSlib directories containing only libhts.so (thus without libhts.a, i.e., when you have built only the shared library).
Warning fixes in the XS module code. With these patches, if you hack
-Wno-unused
into Build.PL:then the XS and .c code will compile without any warnings. Which makes it easier to see the warnings in your own new code. :smile:
If you don't add
-Wno-unused
as well, you get a lot of unused variable warnings — notably forpackname
, which is universally unused.