throw bug with 64-bit compiles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

I am using GCC 4.0.1 (Apple's build), and -m64 for x86_64.

I am seeing two puzzling warnings...
test.cpp:21: warning: implicit conversion shortens 64-bit value into a 32-bit value
test.cpp:21: warning: implicit conversion shortens 64-bit value into a 32-bit value

# gcc --version
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)

I wrote a minimal test case.

# cat test.cpp
// g++ -Wshorten-64-to-32 -m64 -c test.cpp

struct Alpha
{
};

struct Beta
{
};

struct Delta
  :
  public Alpha,
  public Beta
{
  void rethrow() const;
};

void Delta::rethrow() const
{
  throw *this; // <-- two warnings generated here.
}
// end of test.cpp

Any thoughts as to why the warning is being emitted?

Are the warnings relatively benign and ignorable?  Or need I be alarmed (and any workarounds)?

Thanks,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux