public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* 64-Bit Operator Overloading Adventure
@ 2008-01-12 22:55 Brian D. McGrew
  2008-01-14  3:20 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Brian D. McGrew @ 2008-01-12 22:55 UTC (permalink / raw)
  To: gcc-help, gcc

Good morning,

I've got a codebase that's a hundred years old, started in life on Sun3
and have evolved to 32-Bit X86 Linux (Fedora 5).  We're trying to move
to 64-Bit now and this same code that has compiled for years is barking
about operators cannot be overloaded.

This is a Fedora 8 x86-64 machine using gcc-4.1.2 (stock Fedora).  I'm
brand new to 64-Bit but all of this compiles and runs just fine on
32-Bit using the same compiler!  

I've already changed long to int in many places to maintain 32-bit where
I know I need it but I don't think that has anything to do with the
errors from overloaded operators.

Can anyone offer me some help or point me in the right direction?

Thanks,

-brian

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 64-Bit Operator Overloading Adventure
  2008-01-12 22:55 64-Bit Operator Overloading Adventure Brian D. McGrew
@ 2008-01-14  3:20 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2008-01-14  3:20 UTC (permalink / raw)
  To: Brian D. McGrew; +Cc: gcc-help

On 11/01/2008, Brian D. McGrew <brian@visionpro.com> wrote:
> Good morning,

Hi,
I've only replied to gcc-help as this is not related to development of GCC.

> I've got a codebase that's a hundred years old, started in life on Sun3
> and have evolved to 32-Bit X86 Linux (Fedora 5).  We're trying to move
> to 64-Bit now and this same code that has compiled for years is barking
> about operators cannot be overloaded.

Without more detail it's hard to know, but it sounds like you might
have overloads using typedefs where the underlying type has changed.

e.g.

#ifdef  IN_32_BIT_MODE
typedef long foo_t;
#else
typedef int foo_t;
#endif

struct S
{
    S operator+(int);
    S operator+(foo_t);
};

This will only compile if IN_32_BIT_MODE is defined.

Alternatively, the changes you've made to change longs to ints could
cause a problem in code like this:

typedef int bar_t;

struct S
{
    S operator+(long);   // change to int
    S operator+(bar_t);
};



Jon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-12  3:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-12 22:55 64-Bit Operator Overloading Adventure Brian D. McGrew
2008-01-14  3:20 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).