#235 compiling compress.cc fails with USE_BZIP2 and recent gcc

closed-fixed
nobody
advcomp (12)
3
2013-03-01
2012-02-26
No

compress.cc fails compiling after running configure with --enable-bzip2, using a recent version of gcc (I tried with gcc 4.4.6 on amd64)

$ ./configure --enable-bzip2

$ make
make all-am
make[1]: Entering directory `/home/neo/advancecomp-1.15'

g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -DUSE_ERROR_SILENT -DUSE_COMPRESS -c -o compress.o compress.cc
compress.cc: In function 'bool compress_bzip2(const unsigned char*, unsigned int, unsigned char*, unsigned int&, int, int)':
compress.cc:186: error: invalid conversion from 'unsigned char*' to 'char*'
compress.cc:186: error: initializing argument 1 of 'int BZ2_bzBuffToBuffCompress(char*, unsigned int*, char*, unsigned int, int, int, int)'
compress.cc:186: error: invalid conversion from 'unsigned char*' to 'char*'
compress.cc:186: error: initializing argument 3 of 'int BZ2_bzBuffToBuffCompress(char*, unsigned int*, char*, unsigned int, int, int, int)'
compress.cc: In function 'bool decompress_bzip2(const unsigned char*, unsigned int, unsigned char*, unsigned int)':
compress.cc:193: error: invalid conversion from 'unsigned char*' to 'char*'
compress.cc:193: error: initializing argument 1 of 'int BZ2_bzBuffToBuffDecompress(char*, unsigned int*, char*, unsigned int, int, int)'
compress.cc:193: error: invalid conversion from 'unsigned char*' to 'char*'
compress.cc:193: error: initializing argument 3 of 'int BZ2_bzBuffToBuffDecompress(char*, unsigned int*, char*, unsigned int, int, int)'
make[1]: *** [compress.o] Error 1

There is a patch in Gentoo that seems to work fine:

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-arch/advancecomp/files/

However, it is preceded by a comment "bzip2 support wont compile, here's a quick patch". So maybe you know a better solution.

Discussion

  • Andrea Mazzoleni

    • priority: 5 --> 3
    • status: open --> closed-fixed
     
  • Andrea Mazzoleni

    The fix is now in git.

    Thanks.

     

Log in to post a comment.