GNOME Bugzilla – Bug 755545
functors/slot.h broken?
Last modified: 2015-09-28 14:53:59 UTC
Hi. Trying to compile an application that depends on libsigc++, I end up with: /usr/local/include/sigc++-2.0/sigc++/functors/slot.h:137:20: error: void value not ignored as it ought to be (a_1); I am not sure whether this is related to https://bugzilla.gnome.org/show_bug.cgi?id=753612
Line 137 in slot.h is part of sigc::internal::slot_call1::call_it(). Does the compiler tell you from where it is called, and with what parameters? Does this happen in code that can be built with an earlier version of libsigc++?
A small test case would be appreciated.
(In reply to Kjell Ahlstedt from comment #1) > Line 137 in slot.h is part of sigc::internal::slot_call1::call_it(). > Does the compiler tell you from where it is called, and with what parameters? > Does this happen in code that can be built with an earlier version of > libsigc++? Hi Kjell. The error happens when compiling "ardour" (https://ardour.org/). It used to work with previous version of libsigc++. I will try to come up with a test case, but c++ is really _not_ my thing... Thanks. That's the entire error message: g++ -o libs/gtkmm2ext/gtk_ui.os -c -O2 -pipe -std=c++11 -Woverloaded-virtual -DGTK_NEW_TOOLTIP_API -DPACKAGE=\"libgtkmm2ext\" -DLIBSIGC_DISABLE_DEPRECATED -O3 -fomit-frame-pointer -ffast-math -fstrength-reduce -pipe -DARCH_X86 -DBUILD_SSE_OPTIMIZATIONS -DUSE_X86_64_ASM -Wall -DHAVE_LIBLO -DPROGRAM_NAME=\"Ardour\" -D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_FORMAT_MACROS -Ilibs -DENABLE_NLS -pthread -pthread -pthread -D_REENTRANT -DLOCALEDIR=\"/usr/local/share/locale\" -fPIC -Ilibs/pbd -I/usr/local/include/sigc++-2.0 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/gtkmm-2.4 -I/usr/local/include/cairomm-1.0 -I/usr/local/lib/pangomm-1.4/include -I/usr/local/include/pangomm-1.4 -I/usr/local/lib/glibmm-2.4/include -Ilibs/gtkmm2ext -I/usr/local/include/harfbuzz -I/usr/local/lib/sigc++-2.0/include -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/gtk-2.0 -I/usr/local/include/gdkmm-2.4 -I/usr/local/lib/gtk-2.0/include -I/usr/local/include -I/usr/local/include/giomm-2.4 -I/usr/local/include/atkmm-1.6 -I/usr/X11R6/include/freetype2 -I/usr/local/include/libpng16 -I/usr/X11R6/include/pixman-1 -I/usr/local/include/gtk-unix-print-2.0 -I/usr/local/include/cairo -I/usr/local/lib/cairomm-1.0/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/giomm-2.4/include -I/usr/include -I/usr/X11R6/include -I/usr/local/include/glibmm-2.4 -I/usr/local/lib/gdkmm-2.4/include -I/usr/local/lib/glib-2.0/include -I/usr/local/include/pango-1.0 -I/usr/local/lib/gtkmm-2.4/include -I/usr/local/include/atk-1.0 libs/gtkmm2ext/gtk_ui.cc In file included from /usr/local/include/sigc++-2.0/sigc++/signal_base.h:27:0, from /usr/local/include/sigc++-2.0/sigc++/signal.h:8, from /usr/local/include/sigc++-2.0/sigc++/sigc++.h:86, from /usr/local/include/glibmm-2.4/glibmm/thread.h:51, from /usr/local/include/glibmm-2.4/glibmm.h:87, from /usr/local/include/gtkmm-2.4/gtkmm.h:87, from libs/gtkmm2ext/gtk_ui.cc:29: /usr/local/include/sigc++-2.0/sigc++/functors/slot.h: In instantiation of 'static T_return sigc::internal::slot_call1<T_functor, T_return, T_arg1>::call_it(sigc::internal::slot_rep*, sigc::type_trait_take_t<T_arg3>) [with T_functor = std::_Bind<sigc::pointer_functor2<_GdkEventAny*, Gtk::Window*, bool>(Gtk::Window*)>; T_return = bool; T_arg1 = _GdkEventAny*; sigc::type_trait_take_t<T_arg3> = _GdkEventAny* const&]': /usr/local/include/sigc++-2.0/sigc++/functors/slot.h:144:37: required from 'static void* (* sigc::internal::slot_call1<T_functor, T_return, T_arg1>::address())(void*) [with T_functor = std::_Bind<sigc::pointer_functor2<_GdkEventAny*, Gtk::Window*, bool>(Gtk::Window*)>; T_return = bool; T_arg1 = _GdkEventAny*; sigc::internal::hook = void* (*)(void*)]' /usr/local/include/sigc++-2.0/sigc++/functors/slot.h:543:91: required from 'sigc::slot1<T_return, T_arg1>::slot1(const T_functor&) [with T_functor = std::_Bind<sigc::pointer_functor2<_GdkEventAny*, Gtk::Window*, bool>(Gtk::Window*)>; T_return = bool; T_arg1 = _GdkEventAny*]' /usr/local/include/sigc++-2.0/sigc++/functors/slot.h:1273:26: required from 'sigc::slot<T_return, T_arg1, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor = std::_Bind<sigc::pointer_functor2<_GdkEventAny*, Gtk::Window*, bool>(Gtk::Window*)>; T_return = bool; T_arg1 = _GdkEventAny*]' libs/gtkmm2ext/gtk_ui.cc:103:95: required from here /usr/local/include/sigc++-2.0/sigc++/functors/slot.h:137:20: error: void value not ignored as it ought to be (a_1); ^
I'm confused by this part of the compiler output: In instantiation of 'static T_return sigc::internal:: slot_call1<T_functor, T_return, T_arg1>:: call_it(sigc::internal::slot_rep*, sigc::type_trait_take_t<T_arg3>) T_arg3 is surprising. It should be T_arg1. Is it possible that your copy of /usr/local/include/sigc++-2.0/sigc++/functors/slot.h is damaged? Probably at line 132. I doubt it, but it's worth checking. When I replaced T_arg1 by T_arg3 in slot.h:132, I got the more reasonable error message 'T_arg3' was not declared in this scope An aside: One of your compiler options is -DLIBSIGC_DISABLE_DEPRECATED. You should change it to -DSIGCXX_DISABLE_DEPRECATED. Until the year 2007, deprecated code was marked with LIBSIGC_DISABLE_DEPRECATED. Then all deprecated code was removed. When I deprecated some other code in 2013, I marked it with SIGCXX_DISABLE_DEPRECATED. That's unfortunate. When I introduced SIGCXX_DISABLE_DEPRECATED, I was not aware that LIBSIGC_DISABLE_DEPRECATED had been used 6 years before.
(In reply to Kjell Ahlstedt from comment #4) > I'm confused by this part of the compiler output: > > In instantiation of 'static T_return sigc::internal:: > slot_call1<T_functor, T_return, T_arg1>:: > call_it(sigc::internal::slot_rep*, sigc::type_trait_take_t<T_arg3>) > > T_arg3 is surprising. It should be T_arg1. Is it possible that your copy of > /usr/local/include/sigc++-2.0/sigc++/functors/slot.h is damaged? Probably at > line 132. I doubt it, but it's worth checking. When I replaced T_arg1 by > T_arg3 > in slot.h:132, I got the more reasonable error message > 'T_arg3' was not declared in this scope I think the file is fine (line 132 and above): static T_return call_it(slot_rep* rep, type_trait_take_t<T_arg1> a_1) { typedef typed_slot_rep<T_functor> typed_slot; typed_slot *typed_rep = static_cast<typed_slot*>(rep); return (typed_rep->functor_).SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_take_t<T_arg1>> (a_1); } > An aside: One of your compiler options is -DLIBSIGC_DISABLE_DEPRECATED. > You should change it to -DSIGCXX_DISABLE_DEPRECATED. > > Until the year 2007, deprecated code was marked with > LIBSIGC_DISABLE_DEPRECATED. > Then all deprecated code was removed. When I deprecated some other code in > 2013, I marked it with SIGCXX_DISABLE_DEPRECATED. That's unfortunate. When I > introduced SIGCXX_DISABLE_DEPRECATED, I was not aware that > LIBSIGC_DISABLE_DEPRECATED had been used 6 years before. Ah, that's good to know, thanks for the hint :-)
It will be difficult to fix this bug without a test case. All test cases in the libsigc++2/tests directory compile just fine. Perhaps ardour uses libsigc++ in an unusual way. If you have problems making a small test case, perhaps I can get some idea, if I see the code in libs/gtkmm2ext/gtk_ui.cc:137 where sigc::slot is called. Is the code available on the web? Can you show a link? Another aside: You should update ardour to use gtkmm 3 instead of gtkmm 2.
(In reply to Kjell Ahlstedt from comment #6) > It will be difficult to fix this bug without a test case. All test cases in > the > libsigc++2/tests directory compile just fine. Perhaps ardour uses libsigc++ > in > an unusual way. If you have problems making a small test case, perhaps I can > get some idea, if I see the code in libs/gtkmm2ext/gtk_ui.cc:137 where > sigc::slot is called. Is the code available on the web? Can you show a link? Hi Kjell. Yeah, I'll do my homework and try to provide better info. > Another aside: You should update ardour to use gtkmm 3 instead of gtkmm 2. That's actually the first thing I'm going to try. Maybe it'll help. I'll get back to you as soon as I have something :-) Thanks again.
Ok, it looks like adding: namespace sigc { SIGC_FUNCTORS_HAVE_RESULT_TYPE } fixes that particular issue. I think ardour code is a bit old, I'll have a look with upstream. Thanks again for all the pointers Kjell.