Re: [lftp-devel] Compile error: RedHat 9 LFTP 4.6.0
On Sat, Dec 06, 2014 at 09:56:02PM -0600, Andrew Reis wrote: > make[1]: Entering directory `/root/lftp-4.6.0/src' [snip] > In file included from Torrent.cc:34: > > Torrent.h: In member function `void TorrentPiece::set_downloader(unsigned > int, > >const TorrentPeer*, const TorrentPeer*, unsigned int)': > > Torrent.h:116: variable-sized object of type `const TorrentPeer*[blk_count]' > >may not be initialized This is apparently an error, I chalk the lack of 'error:' qualifier up to this being a horribly ancient compiler. It appears that the compiler does not implement C++03 value-initialization of newed arrays, which the lftp source code does with the trailing empty parentheses on line 116. They should mean that the elements of the array are value-initialized, which for pointer types is initializing to a null pointer. The solution is simple, explicitly clear the storage. As for whether upstream wants to have such filthy hacks in their codebase, that's up to them. The patch below should get your build to finish, it did on my newly set up RH9 virtual machine. [zao@localhost zao]$ diff -u {orig,reis}/lftp-4.6.0/src/Torrent.h --- orig/lftp-4.6.0/src/Torrent.h 2014-09-26 10:07:36.0 +0200 +++ reis/lftp-4.6.0/src/Torrent.h 2014-12-30 04:16:37.0 +0100 @@ -113,7 +113,8 @@ if(!downloader) { if(o || !n) return; -downloader=new const TorrentPeer*[blk_count](); +downloader=new const TorrentPeer*[blk_count]; +memset(downloader.get_non_const(),0,blk_count*sizeof(const TorrentPeer*)); } const TorrentPeer*& d=downloader[block]; if(d==o) { [zao@localhost zao]$ > ___ > lftp-devel mailing list > lftp-devel@uniyar.ac.ru > http://univ.uniyar.ac.ru/mailman/listinfo/lftp-devel -- Lars Viklund | z...@acc.umu.se ___ lftp-devel mailing list lftp-devel@uniyar.ac.ru http://univ.uniyar.ac.ru/mailman/listinfo/lftp-devel
Re: [lftp-devel] Compile error: RedHat 9 LFTP 4.6.0
On Fri, Dec 19, 2014 at 07:32:24PM -0600, Andrew Reis wrote: > Has anyone received this? Everyone subscribed to the list has, as well as this followup. > From: lftp-devel [mailto:lftp-devel-boun...@uniyar.ac.ru] On Behalf Of > Andrew Reis > Sent: Saturday, December 6, 2014 21:56 > To: lftp-devel@uniyar.ac.ru > Subject: [lftp-devel] Compile error: RedHat 9 LFTP 4.6.0 > Importance: High Cute header. > make[1]: Entering directory `/root/lftp-4.6.0/src' [snip truncated output] > make[1]: *** [Torrent.lo] Error 1 There are no errors mentioned in the output above and there is no -Werror parameter to the compiler, so you're likely missing some relevant output. > gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) You may want to consider finding/building a compiler that's not eleven years old, particularly as you're trying to build C++ source code. It's possible to build and link lftp statically against most libraries it depends on, including the C and C++ runtime. This is handy if you don't want to pollute a production system with newfangled compilers and libraries. -- Lars Viklund | z...@acc.umu.se ___ lftp-devel mailing list lftp-devel@uniyar.ac.ru http://univ.uniyar.ac.ru/mailman/listinfo/lftp-devel
Re: [lftp-devel] Compile error: RedHat 9 LFTP 4.6.0
Has anyone received this? Andrew Reis MCTS, Network+, Mobility+ Network/Systems Analyst & Webmaster From: lftp-devel [mailto:lftp-devel-boun...@uniyar.ac.ru] On Behalf Of Andrew Reis Sent: Saturday, December 6, 2014 21:56 To: lftp-devel@uniyar.ac.ru Subject: [lftp-devel] Compile error: RedHat 9 LFTP 4.6.0 Importance: High make[1]: Entering directory `/root/lftp-4.6.0/src' /bin/sh ../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I.-I../lib -I../lib -I../trio -I/usr/lib/include-O2 -Wall -Wwrite-strings -Wo verloaded-virtual -fno-exceptions -fno-rtti -fno-implement-inlines -MT Torrent.l o -MD -MP -MF .deps/Torrent.Tpo -c -o Torrent.lo Torrent.cc In file included from ResMgr.h:29, from FileAccess.h:29, from Torrent.h:23, from Torrent.cc:34: xarray.h: In instantiation of `xarray_p<_xmap::entry>': xmap.h:38: instantiated from here xarray.h:194: warning: `class xarray_p<_xmap::entry>' has virtual functions but non-virtual destructor In file included from ArgV.h:24, from FileAccess.h:31, from Torrent.h:23, from Torrent.cc:34: xarray.h: In instantiation of `xarray_p': StringSet.h:27: instantiated from `xarray_m' StringSet.h:27: instantiated from here xarray.h:194: warning: `class xarray_p' has virtual functions but non-virtual destructor xarray.h: In instantiation of `xarray_m': StringSet.h:27: instantiated from here xarray.h:233: warning: `class xarray_m' has virtual functions but non-virtual destructor In file included from Torrent.h:24, from Torrent.cc:34: xarray.h: In instantiation of `xarray_p': Bencode.h:39: instantiated from here xarray.h:194: warning: `class xarray_p' has virtual functions but non-virtual destructor In file included from Torrent.h:31, from Torrent.cc:34: xarray.h: In instantiation of `xarray_p': DHT.h:141: instantiated from here xarray.h:194: warning: `class xarray_p' has virtual functions but non-virtual destructor xarray.h: In instantiation of `xarray_p': xarray.h:241: instantiated from `_xqueue, xstring* >' DHT.h:167: instantiated from `xqueue_p' DHT.h:167: instantiated from here xarray.h:194: warning: `class xarray_p' has virtual functions but non-virtual destructor In file included from Torrent.cc:34: Torrent.h: In member function `void TorrentPiece::set_downloader(unsigned int, const TorrentPeer*, const TorrentPeer*, unsigned int)': Torrent.h:116: variable-sized object of type `const TorrentPeer*[blk_count]' may not be initialized In file included from TorrentTracker.h:23, from Torrent.cc:35: url.h: At global scope: url.h:72: warning: `warn_unused_result' attribute directive ignored make[1]: *** [Torrent.lo] Error 1 make[1]: Leaving directory `/root/lftp-4.6.0/src' make: *** [all-recursive] Error 1 configured with: ./configure --prefix=/usr --sysconfdir=/etc --with-openssl=/usr/lib Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) OpenSSL 1.0.1j Readline 6.3 Expat 2.1.0 Thanks, Andrew Reis DBMS Inc. ___ lftp-devel mailing list lftp-devel@uniyar.ac.ru http://univ.uniyar.ac.ru/mailman/listinfo/lftp-devel
[lftp-devel] Compile error: RedHat 9 LFTP 4.6.0
make[1]: Entering directory `/root/lftp-4.6.0/src' /bin/sh ../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I.-I../lib -I../lib -I../trio -I/usr/lib/include-O2 -Wall -Wwrite-strings -Wo verloaded-virtual -fno-exceptions -fno-rtti -fno-implement-inlines -MT Torrent.l o -MD -MP -MF .deps/Torrent.Tpo -c -o Torrent.lo Torrent.cc In file included from ResMgr.h:29, from FileAccess.h:29, from Torrent.h:23, from Torrent.cc:34: xarray.h: In instantiation of `xarray_p<_xmap::entry>': xmap.h:38: instantiated from here xarray.h:194: warning: `class xarray_p<_xmap::entry>' has virtual functions but non-virtual destructor In file included from ArgV.h:24, from FileAccess.h:31, from Torrent.h:23, from Torrent.cc:34: xarray.h: In instantiation of `xarray_p': StringSet.h:27: instantiated from `xarray_m' StringSet.h:27: instantiated from here xarray.h:194: warning: `class xarray_p' has virtual functions but non-virtual destructor xarray.h: In instantiation of `xarray_m': StringSet.h:27: instantiated from here xarray.h:233: warning: `class xarray_m' has virtual functions but non-virtual destructor In file included from Torrent.h:24, from Torrent.cc:34: xarray.h: In instantiation of `xarray_p': Bencode.h:39: instantiated from here xarray.h:194: warning: `class xarray_p' has virtual functions but non-virtual destructor In file included from Torrent.h:31, from Torrent.cc:34: xarray.h: In instantiation of `xarray_p': DHT.h:141: instantiated from here xarray.h:194: warning: `class xarray_p' has virtual functions but non-virtual destructor xarray.h: In instantiation of `xarray_p': xarray.h:241: instantiated from `_xqueue, xstring* >' DHT.h:167: instantiated from `xqueue_p' DHT.h:167: instantiated from here xarray.h:194: warning: `class xarray_p' has virtual functions but non-virtual destructor In file included from Torrent.cc:34: Torrent.h: In member function `void TorrentPiece::set_downloader(unsigned int, const TorrentPeer*, const TorrentPeer*, unsigned int)': Torrent.h:116: variable-sized object of type `const TorrentPeer*[blk_count]' may not be initialized In file included from TorrentTracker.h:23, from Torrent.cc:35: url.h: At global scope: url.h:72: warning: `warn_unused_result' attribute directive ignored make[1]: *** [Torrent.lo] Error 1 make[1]: Leaving directory `/root/lftp-4.6.0/src' make: *** [all-recursive] Error 1 configured with: ./configure --prefix=/usr --sysconfdir=/etc --with-openssl=/usr/lib Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) OpenSSL 1.0.1j Readline 6.3 Expat 2.1.0 Thanks, Andrew Reis DBMS Inc. ___ lftp-devel mailing list lftp-devel@uniyar.ac.ru http://univ.uniyar.ac.ru/mailman/listinfo/lftp-devel