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 89951 - gtkmm cvs doesn't compile with gcc 2.95.3 due to internal compiler error
gtkmm cvs doesn't compile with gcc 2.95.3 due to internal compiler error
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: build
2.0
Other other
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2002-08-05 18:53 UTC by Martin Schulze
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
adds macro to check for this case and define a symbol (1.81 KB, patch)
2002-08-08 21:34 UTC, jwy
none Details | Review
Promised patch... (4.64 KB, patch)
2002-08-09 18:43 UTC, Martin Schulze
none Details | Review
Hack that makes the critical treeview stuff compile with gcc 2.95.3... (7.32 KB, patch)
2002-08-09 20:15 UTC, Martin Schulze
none Details | Review
Hopefully working patch with configure check. It should work now - please try again. (4.64 KB, patch)
2002-08-09 20:24 UTC, Martin Schulze
none Details | Review
Patch solving the problem for gcc 2.95.3 via namespace TreeView_Private. (11.28 KB, patch)
2002-08-10 11:21 UTC, Martin Schulze
none Details | Review
Resolve the doc issue. (1.33 KB, patch)
2002-08-18 11:22 UTC, Martin Schulze
none Details | Review

Description Martin Schulze 2002-08-05 18:53:28 UTC
Unless we require a newer gcc, people will experience the following error
when compiling with gcc 2.95.3:

source='fileselection.cc' object='fileselection.lo' libtool=yes \
depfile='.deps/fileselection.Plo' tmpdepfile='.deps/fileselection.TPlo' \
depmode=gcc /bin/sh ../../scripts/depcomp \
/bin/sh ../../libtool --mode=compile g++ -DHAVE_CONFIG_H
-DG_LOG_DOMAIN=\"gtkmm\" -Dgtkmm_COMPILATION -DG_DISABLE_DEPRECATED
-DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED
-DGTK_DISABLE_DEPRECATED  -I../../glib -I../../glib -I../../pango -I../.  
 ./pango -I../../atk -I../../atk -I../../gdk -I../../gdk -I../../gtk
-I../../gtk -I/usr/local/lib/sigc++-1.2/include
-I/usr/local/include/sigc++-1.2 -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/Xft2 -I/usr/include/freetype2 -I/usr/X11R6/include
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_REENTRANT
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include    -g -O2 -c -o
fileselection.lo `test -f fileselection.cc || echo './'`fileselection.cc
g++ -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"gtkmm\" -Dgtkmm_COMPILATION
-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED
-DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -I../../glib
-I../../glib -I../../pango -I../../pango -I../../atk -I../../atk
-I../../gdk -I../../gdk -I../../gtk -I../../gtk
-I/usr/local/lib/sigc++-1.2/include -I/usr/local/include/sigc++-1.2
-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/Xft2 -I/usr/include/freetype2
-I/usr/X11R6/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -c
fileselection.cc -Wp,-MD,.deps/fileselection.TPlo  -fPIC -DPIC -o
fileselection.lo
In file included from ../../gtk/gtkmm/fileselection.h:35,
                 from fileselection.cc:3:
../../gtk/gtkmm/treeview.h: In method `void
Gtk::TreeView::_connect_auto_store_editable_signal_handler<int>(Gtk::CellRenderer
*, const Gtk::TreeModelColumn<int> &)':
../../gtk/gtkmm/treeview.h:605: Internal compiler error.
../../gtk/gtkmm/treeview.h:605: Please submit a full bug report.
../../gtk/gtkmm/treeview.h:605: See
<URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.


treeview.h, line 605 reads:

//Connect to the appropriate signal, sending the model_column too,
pCellText->signal_edited().connect(
  SigC::bind( SigC::slot(*this,
&TreeView::_auto_store_on_cellrenderer_text_edited_numerical<int>),
model_column.index()) );
Comment 1 Murray Cumming 2002-08-05 19:08:40 UTC
Have you tried a new checkout?
Comment 2 Martin Schulze 2002-08-05 19:53:58 UTC
Yes! Latest ChangeLog entry:

2002-08-04  Murray Cumming  <murrayc@usa.net>

        * Fixed dialog lifecycle bug #89557, with a quite large
        reorganisation of the lifecycle code. ...
        ...
Comment 3 Murray Cumming 2002-08-06 07:18:23 UTC
I'll need you to test the tarball, which will be out soon.

If it really doesn't work then we will need to #ifdef that method out
for that compiler.
Comment 4 Martin Schulze 2002-08-06 09:52:11 UTC
O'course I'll test the tarball...
I just tried: if I put #if 0 / #endif around the problematic template
specializations in treeview.hg, current cvs compiles smoothly with gcc
2.95.3 (hopefully - it's not finished yet...).
Comment 5 Murray Cumming 2002-08-06 15:30:20 UTC
Do try to break that function down into simpler lines so that you can
find the real source of the problem.
Comment 6 Martin Schulze 2002-08-07 11:20:00 UTC
Well it definately is a compiler bug! Here is the most simple example
I've found to reproduce it: Referencing the specialization of the
templeted member function foo::doit() from within a member function of
the same class beats gcc 2.95.3!


struct foo {
  template <class C> inline
  void doit();

  void thebug();
};

template <class C> inline
void foo::doit() {
}

void notabug() {
  void (foo::*func)();
  func = &foo::doit<int>;
}

struct bar {
  void neitherabug();
};

void bar::neitherabug() {
  void (foo::*func)();
  func = &foo::doit<int>;
}

void foo::thebug() {
  void (foo::*func)();
  func = &foo::doit<int>;  // line 28
}

void main() {
}


martin@ipc-notebook:~/projects/test > g++ test.cc
test.cc: In method `void foo::thebug()':
test.cc:28: Internal compiler error.
test.cc:28: Please submit a full bug report.
test.cc:28: See <URL:http://www.gnu.org/software/gcc/bugs.html> for
instructions.
Comment 7 Murray Cumming 2002-08-08 16:30:14 UTC
Have you submitted that as a gcc bug report?

Maybe you, or someone, could write a configure-time test that detects
this and sets a #define.
Comment 8 Martin Schulze 2002-08-08 19:56:22 UTC
No, I haven't submitted a bug report. It's an old compiler version
after all. The problem is, however, that it is still quite commonly
used (at least all newer SuSE installations including the latest
version 8.0 have it installed as default compiler).
Since I've never written a configure-time check it might take some
time. If anybody feels that he can do this quick then step forward,
please.
Comment 9 jwy 2002-08-08 21:34:54 UTC
Created attachment 10370 [details] [review]
adds macro to check for this case and define a symbol
Comment 10 Murray Cumming 2002-08-09 11:57:15 UTC
Please use gtkmmconfig.h - config.h only seems to be used by the demos.
Comment 11 Martin Schulze 2002-08-09 18:42:44 UTC
New patch is underway. Please try with a decent compiler before
applying! ChangeLog entry:

 * configure.in,scripts/cxx.m4,gtk/gtkmmconfig.h.in: Add configure
 time check as proposed by Joe Yandle with some modifications. It
 checks whether the compiler allows member functions to refer to
 specializations of member function templates.
 * gtk/src/treeview.hg: Use configure time check from above for
 conditional compilation of the critical code.
Comment 12 Martin Schulze 2002-08-09 18:43:35 UTC
Created attachment 10390 [details] [review]
Promised patch...
Comment 13 Murray Cumming 2002-08-09 19:54:40 UTC
Even when I correct the typo ("neiterabug()" and "neitherabug()") I
stil l get this error in my config.log. I'm using gcc 2.96RH, which
does compile the append_column_editable() method.

configure: In function `int main ()':
configure:8351: parse error before `{'
configure:8353: `func' undeclared (first use this function)
configure:8353: (Each undeclared identifier is reported only once for 
each function it appears in.)
configure: At top level:
configure:8367: parse error before `return'
configure:8375: $? = 1
configure: failed program was:
#line 8331 "configure"
#include "confdefs.h"
Comment 14 Martin Schulze 2002-08-09 20:14:20 UTC
UAH, something must have gone wrong while copy&pasting. I'll sort that
out at once. Meanwhile I attach a patch that would hack around the
compiler bug. It's not to my liking though - only an option if it
makes the code compile with _all_ compilers that currently have problems.
Comment 15 Martin Schulze 2002-08-09 20:15:39 UTC
Created attachment 10391 [details] [review]
Hack that makes the critical treeview stuff compile with gcc 2.95.3...
Comment 16 Martin Schulze 2002-08-09 20:24:20 UTC
Created attachment 10392 [details] [review]
Hopefully working patch with configure check. It should work now - please try again.
Comment 17 Murray Cumming 2002-08-09 20:45:38 UTC
Regarding the Hack class, maybe these methods just don't need to be
member methods. Maybe we could just put them in their own
TreeView_Private namespace. Maybe I should have made them static at
least already.
Comment 18 Murray Cumming 2002-08-09 20:53:35 UTC
configure test patch applied, and works on gcc 2.96RH. But I hope we
don't need to use it.
Comment 19 Martin Schulze 2002-08-10 11:20:03 UTC
TreeView_Private - now, that sound like a decent name for this
delicate thing :-) I provide a patch that solves the problem for gcc
2.95.3 this way. Someone with Sun Forte compiler (was that the other
buggy one?) should check whether it compiles there, too. Otherwise we
need to modify our configure check or fall back to the solution
currently in cvs.
Ah, and have a look at the 'friend' definition, please. It compiles
for me but I'm not sure whether this is clean and safe...
Comment 20 Martin Schulze 2002-08-10 11:21:07 UTC
Created attachment 10398 [details] [review]
Patch solving the problem for gcc 2.95.3 via namespace TreeView_Private.
Comment 21 Murray Cumming 2002-08-10 14:54:21 UTC
Works for me. (gcc 2.96 on RH7.2)
Comment 22 Murray Cumming 2002-08-10 17:58:14 UTC
Do also check that the editable cells example in demos/gtk-demo really
works too. You should be able to edit the cells.
Comment 23 Martin Schulze 2002-08-10 19:18:29 UTC
The editable cells demo works as expected with the latest patch!
Comment 24 Murray Cumming 2002-08-11 12:35:25 UTC
Michael, could you test this last patch? Maybe the examples will now
work with Forte without your #ifdefs.
Comment 25 Murray Cumming 2002-08-12 17:41:47 UTC
Well, I applied it anyway.
Comment 26 Michael v. Szombathely 2002-08-13 10:55:38 UTC
No, it does not change for the Sun Forte C++. The constructor of 
TreeViewColumn with its template parameter still exists.

BTW, our Sun Service has contacted me today. This bug is now fixed in 
their actual being developed 5.5 version of the C++ compiler. They 
are now going to backport it for the 5.3 (Forte WS6U2) and 5.4. (Sun 
ONE) versions of the compiler.
Comment 27 Martin Schulze 2002-08-18 11:21:24 UTC
(Sorry - I would have fixed this myself if cvs write acces already
worked:)
I forgot to exclude the functions in namespace Gtk::TreeView_Private
from the doc generation mechanism.
Comment 28 Martin Schulze 2002-08-18 11:22:18 UTC
Created attachment 10552 [details] [review]
Resolve the doc issue.