GNOME Bugzilla – Bug 454882
bad declaration of slot_list error with gcc 4.3.0 experimental
Last modified: 2008-01-01 20:40:06 UTC
While compiling sigc++ (or any mm package using libsigc++) using ubuntu gcc-snapshot (4.3.0 20070414): /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:1675: error: declaration of 'typedef struct sigc::slot_list<sigc::slot<T_return, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> > sigc::signal0<T_return, T_accumulator>::slot_list' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:168: error: changes meaning of 'slot_list' from 'struct sigc::slot_list<sigc::slot<T_return, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> >' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:1784: error: declaration of 'typedef struct sigc::slot_list<sigc::slot<T_return, T_arg1, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> > sigc::signal1<T_return, T_arg1, T_accumulator>::slot_list' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:168: error: changes meaning of 'slot_list' from 'struct sigc::slot_list<sigc::slot<T_return, T_arg1, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> >' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:1895: error: declaration of 'typedef struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> > sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::slot_list' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:168: error: changes meaning of 'slot_list' from 'struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> >' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:2008: error: declaration of 'typedef struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, T_arg3, sigc::nil, sigc::nil, sigc::nil, sigc::nil> > sigc::signal3<T_return, T_arg1, T_arg2, T_arg3, T_accumulator>::slot_list' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:168: error: changes meaning of 'slot_list' from 'struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, T_arg3, sigc::nil, sigc::nil, sigc::nil, sigc::nil> >' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:2123: error: declaration of 'typedef struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, T_arg3, T_arg4, sigc::nil, sigc::nil, sigc::nil> > sigc::signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_accumulator>::slot_list' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:168: error: changes meaning of 'slot_list' from 'struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, T_arg3, T_arg4, sigc::nil, sigc::nil, sigc::nil> >' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:2240: error: declaration of 'typedef struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, sigc::nil, sigc::nil> > sigc::signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_accumulator>::slot_list' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:168: error: changes meaning of 'slot_list' from 'struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, sigc::nil, sigc::nil> >' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:2359: error: declaration of 'typedef struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, sigc::nil> > sigc::signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_accumulator>::slot_list' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:168: error: changes meaning of 'slot_list' from 'struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, sigc::nil> >' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:2480: error: declaration of 'typedef struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7> > sigc::signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_accumulator>::slot_list' /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:168: error: changes meaning of 'slot_list' from 'struct sigc::slot_list<sigc::slot<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7> >'
The latest Ubuntu (Gutsy) currently uses g++ 4.1.2. Is 4.3 likely to be used by any distro soon? > /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:1675: error: declaration of > 'typedef struct sigc::slot_list<sigc::slot<T_return, sigc::nil, sigc::nil, > sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> > > sigc::signal0<T_return, T_accumulator>::slot_list' is this: #ifdef SIGC_TYPEDEF_REDEFINE_ALLOWED /** This typedef is only for backwards-compatibility. * It is not available when using the SUN Forte compiler. * @deprecated slot_list_type; */ typedef slot_list_type slot_list; #endif > /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:168: error: changes meaning of > 'slot_list' from 'struct sigc::slot_list<sigc::slot<T_return, sigc::nil, > sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> >' > /opt/gnome2/include/sigc++-2.0/sigc++/signal.h:1784: error: declaration of > 'typedef struct sigc::slot_list<sigc::slot<T_return, T_arg1, sigc::nil, > sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> > > sigc::signal1<T_return, T_arg1, T_accumulator>::slot_list' is this: template <class T_slot> struct slot_list { ... } I notice that my Ubuntu Feisty and Gutsy builds (both g++ 4.1.2) do not define SIGC_TYPEDEF_REDEFINE_ALLOWED in sigc++config.h. I guess yours does. Maybe the configure test needs to be improved, or maybe we need a new test. If we don't figure it out, we can just force it to be set.
See also http://bugzilla.gnome.org/show_bug.cgi?id=302098
I have just released libsigc++ 2.1.1, with the deprecated API removed. I would like you to test it, please. It should appear here soon: http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.1/
Created attachment 101924 [details] [review] libsigc++-2.1.1-gcc-4.3.patch I was able to successfully build libsigc++-2.1.1 with gcc-4.3 HEAD with one small patch (attached). ./configure --prefix=/usr --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-debug=no --libdir=/usr/lib64 --build=x86_64-pc-linux-gnu gcc version 4.3.0-pre20071228 (experimental) (GCC) x86_64-pc-linux-gnu-g++ -I. -I.. -I.. -I.. -O3 -g -march=native -fomit-frame-pointer -pipe -fdirectives-only -MT test_copy_invalid_slot.o -MD -MP -MF .deps/test_copy_invalid_slot.Tpo -c -o test_copy_invalid_slot.o test_copy_invalid_slot.cc test_copy_invalid_slot.cc: In function 'int main(int, char**)': test_copy_invalid_slot.cc:22: error: 'malloc' was not declared in this scope test_copy_invalid_slot.cc:23: error: 'memset' was not declared in this scope test_copy_invalid_slot.cc:31: error: 'free' was not declared in this scope make[2]: *** [test_copy_invalid_slot.o] Error 1 http://www.cyrius.com/journal/2007/05/10#gcc-4.3-include
Thanks. Committed. Please remember to patch the ChangeLog in future.
Hey Murray, Looking at svn, it looks like you actually fixed this a few weeks ago with r291. ;) http://svn.gnome.org/viewvc/libsigc%2B%2B2/trunk/tests/test_copy_invalid_slot.cc?r1=291&r2=290&pathrev=291 So looks like my change isn't necessary.