public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Jonathan Wakely" <jwakely.gcc@gmail.com>
To: "Brian D. McGrew" <brian@visionpro.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: 64-Bit Operator Overloading Adventure
Date: Mon, 14 Jan 2008 03:20:00 -0000	[thread overview]
Message-ID: <4348dea50801111902s6e0881br8a86c98b3ab36f71@mail.gmail.com> (raw)
In-Reply-To: <01CB178573DD65409C3958440EF758AD106D39@mvpexchange126.machinevisionproducts.com>

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

      reply	other threads:[~2008-01-12  3:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12 22:55 Brian D. McGrew
2008-01-14  3:20 ` Jonathan Wakely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4348dea50801111902s6e0881br8a86c98b3ab36f71@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=brian@visionpro.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).