I've been told that line 111 of debug/logger.cpp doesn't compile with gcc 4. Could someone please give me the specific error (with all context lines, please)?
-mental
MenTaLguY wrote:
I've been told that line 111 of debug/logger.cpp doesn't compile with gcc 4. Could someone please give me the specific error (with all context lines, please)?
-mental
I installed gcc4.0.0 on this laptop to try it again. Here is the same kind of error, but on a different file (debug/heap.cpp). I tried again with a gcc4 cvs snapshot, and got the same thing:
|if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/freetype2 -I/usr/include/freetype2 -I/usr/include/freetype2/config -DPOTRACE="potrace" -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -I/usr/local/include/gtkmm-2.4 -I/usr/local/lib/gtkmm-2.4/include -I/usr/local/include/glibmm-2.4 -I/usr/local/lib/glibmm-2.4/include -I/usr/local/include/gdkmm-2.4 -I/usr/local/lib/gdkmm-2.4/include -I/usr/local/include/pangomm-1.4 -I/usr/local/include/atkmm-1.6 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/gtkspell-2.0 -I../cxxtest -Wall -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -Wno-unused-parameter -g -O2 -MT debug/heap.o -MD -MP -MF "debug/.deps/heap.Tpo" \ -c -o debug/heap.o `test -f 'debug/heap.cpp' || echo './'`debug/heap.cpp; \ then mv -f "debug/.deps/heap.Tpo" "debug/.deps/heap.Po"; \ else rm -f "debug/.deps/heap.Tpo"; exit 1; \ fi
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/st l_vector.h: In member function 'void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = Inkscape::Debug::Heap*, _Alloc = Inkscape::GC::Alloc<Inkscape::Debug::Heap*, MANUAL>]': debug/heap.cpp:127: instantiated from here /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/st l_vector.h:606: error: no matching function for call to 'std::_Vector_base<Inkscape::Debug::Heap*, Inkscape::GC::Alloc<Inkscape::Debug::Heap*, MANUAL>
::_Vector_impl::construct(Inkscape::Debug::Heap**&, Inkscape::Debug::Heap*
const&)' ./gc-alloc.h:54: note: candidates are: void Inkscape::GC::Alloc<T, collect>::construct(T*, T&) [with T = Inkscape::Debug::Heap*, Inkscape::GC::CollectionPolicy collect = MANUAL] /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/ve ctor.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename _Alloc::pointer, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = Inkscape::Debug::Heap*, _Alloc = Inkscape::GC::Alloc<Inkscape::Debug::Heap*, MANUAL>]': /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/st l_vector.h:610: instantiated from 'void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = Inkscape::Debug::Heap*, _Alloc = Inkscape::GC::Alloc<Inkscape::Debug::Heap*, MANUAL>]' debug/heap.cpp:127: instantiated from here /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/ve ctor.tcc:284: error: no matching function for call to 'std::_Vector_base<Inkscape::Debug::Heap*, Inkscape::GC::Alloc<Inkscape::Debug::Heap*, MANUAL>
::_Vector_impl::construct(Inkscape::Debug::Heap** const&,
Inkscape::Debug::Heap* const&)' ./gc-alloc.h:54: note: candidates are: void Inkscape::GC::Alloc<T, collect>::construct(T*, T&) [with T = Inkscape::Debug::Heap*, Inkscape::GC::CollectionPolicy collect = MANUAL] make[2]: *** [debug/heap.o] Error 1
|
On Sun, 2005-05-08 at 19:47, Bob Jamison wrote:
I installed gcc4.0.0 on this laptop to try it again. Here is the same kind of error, but on a different file (debug/heap.cpp).
Ahh... basically GC::Alloc isn't compatible with the new allocator model used with gcc 4. That's the only class that should require fixing..
-mental
On Sun, 2005-05-08 at 19:47, Bob Jamison wrote:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/ve ctor.tcc:284: error: no matching function for call to 'std::_Vector_base<Inkscape::Debug::Heap*, Inkscape::GC::Alloc<Inkscape::Debug::Heap*, MANUAL>
::_Vector_impl::construct(Inkscape::Debug::Heap** const&,
Inkscape::Debug::Heap* const&)' ./gc-alloc.h:54: note: candidates are: void Inkscape::GC::Alloc<T, collect>::construct(T*, T&) [with T = Inkscape::Debug::Heap*, Inkscape::GC::CollectionPolicy collect = MANUAL] make[2]: *** [debug/heap.o] Error 1
Aha. The second argument declared for GC::Alloc<...>::construct ought to be a const reference, since it should generally get passed a const reference.
I'm surprised it compiles with earlier versions of gcc. Very basic const-correctness issue.
I'll commit a fix to CVS. Let me know if you spot any other issues.
-mental
participants (2)
-
Bob Jamison
-
MenTaLguY