I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-05-19 14:13:08-07 by mr
Trouble compiling code - 'warn_unused_result' attribute directive ignored

Any ideas what is going on here? I've tried an assortment of GCC versions and switches, but no luck just yet. Am trying to compile Compress-Raw-Bzip2-2.019 using "perl Makefile.PL ; make".

gcc -c -I. -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gd +bm -DVERSION=\"2.019\" -DXS_VERSION=\"2.019\" -fPIC "-I/pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib +/5.8.9/x86_64-linux/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H blocksort.c gcc -c -I. -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gd +bm -DVERSION=\"2.019\" -DXS_VERSION=\"2.019\" -fPIC "-I/pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib +/5.8.9/x86_64-linux/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H huffman.c gcc -c -I. -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gd +bm -DVERSION=\"2.019\" -DXS_VERSION=\"2.019\" -fPIC "-I/pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib +/5.8.9/x86_64-linux/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H crctable.c gcc -c -I. -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gd +bm -DVERSION=\"2.019\" -DXS_VERSION=\"2.019\" -fPIC "-I/pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib +/5.8.9/x86_64-linux/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H randtable.c gcc -c -I. -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gd +bm -DVERSION=\"2.019\" -DXS_VERSION=\"2.019\" -fPIC "-I/pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib +/5.8.9/x86_64-linux/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H compress.c gcc -c -I. -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gd +bm -DVERSION=\"2.019\" -DXS_VERSION=\"2.019\" -fPIC "-I/pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib +/5.8.9/x86_64-linux/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H decompress.c gcc -c -I. -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gd +bm -DVERSION=\"2.019\" -DXS_VERSION=\"2.019\" -fPIC "-I/pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib +/5.8.9/x86_64-linux/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H bzlib.c gcc -c -I. -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gd +bm -DVERSION=\"2.019\" -DXS_VERSION=\"2.019\" -fPIC "-I/pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib +/5.8.9/x86_64-linux/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H Bzip2.c In file included from /pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib/5.8.9/x86_64-linux/CORE/perl.h:4561, from Bzip2.xs:14: /pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib/5.8.9/x86_64-linux/CORE/proto.h:31: warning: `warn_unused_ +result' attribute directive ignored /pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib/5.8.9/x86_64-linux/CORE/proto.h:42: warning: `warn_unused_ +result' attribute directive ignored /pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib/5.8.9/x86_64-linux/CORE/proto.h:46: warning: `warn_unused_ +result' attribute directive ignored /pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib/5.8.9/x86_64-linux/CORE/proto.h:50: warning: `warn_unused_ +result' attribute directive ignored /pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib/5.8.9/x86_64-linux/CORE/proto.h:60: warning: `warn_unused_ +result' attribute directive ignored In file included from /pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib/5.8.9/x86_64-linux/CORE/perl.h:4561, from Bzip2.xs:14: /pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib/5.8.9/x86_64-linux/CORE/proto.h:72: warning: `warn_unused_ +result' attribute directive ignored ... several pages more of lines similar to the one above ... /pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib/5.8.9/x86_64-linux/CORE/proto.h:2388: warning: `warn_unuse +d_result' attribute directive ignored Running Mkbootstrap for Compress::Raw::Bzip2 () chmod 644 Bzip2.bs rm -f blib/arch/auto/Compress/Raw/Bzip2/Bzip2.so gcc -shared -O2 -L/pkg/perl-/5.8.9-FAM/x86_64-linux2.6/lib blocksort.o huffman.o crctable.o randta +ble.o compress.o decompress.o bzlib.o Bzip2.o -o blib/arch/auto/Compress/Raw/Bzip2/Bzip2.so + \ \ chmod 755 blib/arch/auto/Compress/Raw/Bzip2/Bzip2.so cp Bzip2.bs blib/arch/auto/Compress/Raw/Bzip2/Bzip2.bs chmod 644 blib/arch/auto/Compress/Raw/Bzip2/Bzip2.bs Manifying blib/man3/Compress::Raw::Bzip2.3

If I 'make test' this, it barfs and fails almost all tests and complains of barewords in the .t files. Is this module any good? As best I can tell from reading the Perl code in the test, these ARE barewords in the .t files.

Direct Responses: 10762 | Write a response
Posted on 2009-05-20 08:47:06-07 by pmarquess in response to 10752
Re: Trouble compiling code - 'warn_unused_result' attribute directive ignored
If you run "perl -V" what does it say in the "Compiler" section? Paul
Direct Responses: 10777 | Write a response
Posted on 2009-05-20 15:18:47-07 by mr in response to 10762
Re: Trouble compiling code - 'warn_unused_result' attribute directive ignored
Compiler: cc='gcc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/inclu +de -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/usr/ +include/gdbm' ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-53)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define

Ah... "-Wdeclaration-after-statement". Is this what is plaguing me with my module compile? I don't find gcc 3.2.3 anywhere on the system, though 3.3.2 is (the closest).
Direct Responses: Write a response