GNOME Bugzilla – Bug 386990
glibmm-2.12.3 does not build on NetBSD-4.99.6/amd64
Last modified: 2007-10-25 09:55:21 UTC
glibmm-2.12.3 does not build on NetBSD-4.99.6/amd64. It fails in compiling date.cc: c++ -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"glibmm\" -I../../glib -I/usr/obj/devel/gli bmm/work.x86_64/.buildlink/include/sigc++-2.0 -I/usr/obj/devel/glibmm/work.x86_6 4/.buildlink/lib/sigc++-2.0/include -I/usr/obj/devel/glibmm/work.x86_64/.buildli nk/include/glib/glib-2.0 -I/usr/obj/devel/glibmm/work.x86_64/.buildlink/lib/glib -2.0/include -pthread -I/usr/obj/devel/glibmm/work.x86_64/.buildlink/include -O2 -Wall -Wno-long-long -MT date.lo -MD -MP -MF .deps/date.Tpo -c date.cc -fPIC - DPIC -o .libs/date.o ../../glib/glibmm/date.h:144: error: 'void Glib::Date::set_time(time_t)' cannot be overloaded ../../glib/glibmm/date.h:132: error: with 'void Glib::Date::set_time(GTime)' date.cc:84: error: redefinition of 'void Glib::Date::set_time(time_t)' date.cc:76: error: 'void Glib::Date::set_time(GTime)' previously defined here date.cc: In member function 'void Glib::Date::set_time(GTime)': date.cc:86: error: 'timet' was not declared in this scope
See also http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=34752 Note, however, that making this conditional on _LP64 does not work for me on amd64. I'm not sure why it might work on sparc64.
Created attachment 78880 [details] [review] Fixes the compilation problem Please confirm that this is a correct fix.
Thanks, but no, deprecation doesn't work like that - it's not a way to decide to remove another function from the API. Those ifdefs are unrelated to this problem. The problem seems to be that GTime and time_t are considered to be identical types. If this is the case on this platform, then it can be tested for in the configure stage, and the (newer) unnecessary function can then be ifdefed out.
Could you maybe create a configure test? There are already several tests, though libsigc++ might also contain more similar tests.
I am confused about this, because the GTime documentation http://developer.gnome.org/doc/API/2.0/glib/glib-Date-and-Time-Functions.html#GTime says "Simply a replacement for time_t. It has been deprecated since it is not equivalent to time_t on 64-bit platforms with a 64-bit time_t. " Which means that GTime and time_t should NOT be equivalent on your 64-bit system, so compilation should work, but they SHOULD be equivalent on 32-bit systems, meaning that it shouldn't compile for me. Is your glib patched to fix the GTime problem? What is the definition of GTime in your glib? In my gdate.h, it is " typedef gint32 GTime; " A test would look a bit like this: #include <time.h> typedef signed int gint32; class Test { void something(gint32 val) {} void something(time_t val) {} }; int main() { Test test; return 0; } That should fail for you. It compiles for me.
As you predict, this does not compile for me: # g++ -o test test.c ii.c:10: error: 'void Test::something(time_t)' cannot be overloaded ii.c:7: error: with 'void Test::something(gint32)' #
I added a configure test for this: 2007-03-03 Murray Cumming <murrayc@murrayc.com> * configure.in: * glib/glibmmconfig.h.in: * glib/src/date.ccg: * glib/src/date.hg: * scripts/Makefile.am: * scripts/c_std.m4: Added a test for the case that time_t is equivalent to guint32, as seems to be the case on NetBSD-4.99.6/amd64, so we can ifdef-out the (deprecated, anyway) Glib::Date::set_time(GTime) method when necessary, because GTime is also equivalent to guint32. Bug #386990. So it should be fixed in the tarball that I will release soon. Please reopen this bug if it's still a problem.
I can't repon this bug, but it's still an issue on Gentoo/FreeBSD on x86 platform for glibmm-2.14.0
I see (somewhere, I forget where) that gentoo is patching the header file to define GLIBMM_DISABLE_DEPRECATED. That's a major mistake that changes the API for other files included after that. Please attach your config.log here, so we can see the results of that new configure check.
*** Bug 478199 has been marked as a duplicate of this bug. ***
Created attachment 97475 [details] 2.14.0 config.log
(In reply to comment #9) > I see (somewhere, I forget where) that gentoo is patching the header file to > define GLIBMM_DISABLE_DEPRECATED. No, some GNOME tarballs shipped defining GTK_DISABLE_DEPRECATED (I think) which meant they broke on newer gtk versions. Looking through the code, I can't see any test for time_t or defines that would fix the issue. As such, we physically remove the deprecated declaration and function for x86-fbsd with glibmm-2.14.0 on Gentoo right now. So far this isn't an issue for us.
Sorry. The check was in 2.12.x but somehow was not in 2.14.x. I have just released 2.14.2 which should fix this. Please try it and attach the new config.log here if it doesn't work.
2.14.1 didn't compile for me, but 2.14.2 does (on NetBSD-4.99.34/amd64). Thanks for fixing it (again)!
Confirmed, 2.14.2 fixes things here too. Thanks!