Subject: Re: b20: c++ bug or feature?
From: [email-masked] (Mumit Khan)

19 Nov 1998 04:54:40 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
To: Andres Heinloo <[email-masked]>
Cc: [email-masked], [email-masked]

Andres Heinloo <[email-masked]> writes:
> 
> when compiling gtk-- example program 'OhharaDraw', I get the following
> error:
> 
> OhharaDraw.h:130: sorry, not implemented: object size exceeds normal limit
> for virtual function table implementation, recompile all source and use
> -fhuge-objects

[ I'm copying egcs as well. Hopefully egcs C++ folks will provide some
  insight into this ]

The hierarchy looks like this:
  
  Gtk_Signal_Base <-V- Gtk_Base      <--- Gtk_Object <--- Gtk_Widget 
                  <--- Gtk_Container <--- Gtk_Bin    <--- Gtk_Window 
                  <--- OhharaDraw 

Where I've marked the virtual inheritence with '<-V-'.

When building the vtable for ``OhharaDraw'', the compiler is running
into the limitation that the offset is represented by a signed short,
and cannot hold -45054 (the resulting offset for type info function
in this case).

Any target platform that does not use vtable "thunks" is affected by this. 
For example, HPUX is as affected by it as ix86-win32. ix86-linux uses
vtable thunks by default, so it works there.

Solutions? 

(1) Recompile *everything* with -fvtable-thunks. I don't know if it works
    for x86-win32 targets. 
(2) Recompile *everything* with -fhuge-objects. Hardly an option for real
    life code. Also, I don't know how well debugged -fhuge-objects really
    is, so you might be running into other compiler/library bugs there.
(2) Since there is no multiple inheritance in this particular case (I
    don't know anything about Gtk's design, so may be way off here), make
    Gtk_Signal_Base just a public base class instead of public virtual
    base class.

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".