After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 498438 - gcc-4.3 build issue
gcc-4.3 build issue
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: build
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2007-11-20 09:56 UTC by Sebastien Bacher
Modified: 2008-03-10 15:22 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
fix build issue (350 bytes, patch)
2007-11-20 09:57 UTC, Sebastien Bacher
committed Details | Review
include string.h (546 bytes, patch)
2008-02-19 20:14 UTC, Tim Mooney
committed Details | Review

Description Sebastien Bacher 2007-11-20 09:56:39 UTC
glibmm2.4 2.14.2 does't build with gcc-4.3

/bin/bash ../../libtool --tag=CXX   --mode=compile /usr/lib/gcc-snapshot/bin/g++ -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"glibmm\"  -I../../glib -I../../glib -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include    -g -Wall -O2 -Wno-long-long -c -o object.lo object.cc
 /usr/lib/gcc-snapshot/bin/g++ -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"glibmm\" -I../../glib -I../../glib -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -Wall -O2 -Wno-long-long -c object.cc  -fPIC -DPIC -o .libs/object.o
object.cc: In constructor 'Glib::ConstructParams::ConstructParams(const Glib::Class&, const char*, ...)':
object.cc:110: error: 'memset' was not declared in this scope

Including cstring fixed the issue
Comment 1 Sebastien Bacher 2007-11-20 09:57:15 UTC
Created attachment 99388 [details] [review]
fix build issue
Comment 2 Murray Cumming 2007-11-20 12:10:10 UTC
Feel free to commit with a ChangeLog entry to trunk and gtkmm-2-14. Thanks.
Comment 3 Sebastien Bacher 2007-11-20 19:21:50 UTC
Change commited to glibmm-2-14 and trunk

2007-11-20  Sebastien Bacher  <seb128@ubuntu.com>

	* glib/glibmm/object.cc: fix build issue when using gcc4.3 (#498438)

Comment 4 Tim Mooney 2008-02-19 02:49:39 UTC
The exact same build issue happens on Solaris with the latest Sun C++ compiler
(from the Sun Workshop 12 bundle), but including <cstring> doesn't fix it there.

To fix this issue on Solaris, it's necessary to include string.h.

My guess is that string.h would fix it on Linux too, so perhaps that's worth considering?
Comment 5 Murray Cumming 2008-02-19 17:56:26 UTC
Please do submit a patch so people can test it on Linux.
Comment 6 Tim Mooney 2008-02-19 20:14:32 UTC
Created attachment 105601 [details] [review]
include string.h
Comment 7 Deng Xiyue 2008-02-20 02:00:50 UTC
I guess it might be fixed by adding 'std::' prefix to all string.h function.  <c*> headers should declare functions within namespace std, but it seems on Linux that's not mandatory, and I'm not sure if that's a bug.
Comment 8 Jonathon Jongsma 2008-02-20 03:33:42 UTC
Yes, except in this case, the memset call is coming from a glib macro G_VALUE_COLLECT(), so it's not possible to change the call to add std:: here.  

Isn't the proper fix here to include <string.h> in the gvaluecollect.h header so that everybody that uses that macro doesn't have to include string.h themselves?
Comment 9 Deng Xiyue 2008-02-20 03:58:39 UTC
(In reply to comment #8)
> Yes, except in this case, the memset call is coming from a glib macro
> G_VALUE_COLLECT(), so it's not possible to change the call to add std:: here.  
> 
> Isn't the proper fix here to include <string.h> in the gvaluecollect.h header
> so that everybody that uses that macro doesn't have to include string.h
> themselves?
> 

In such case, one can use "using std::memset;" to bring specifically required functions into global namespace.
Comment 10 Murray Cumming 2008-03-10 15:22:52 UTC
I have committed the patch in comment #6. If something else would be better then please reopen with a new patch.