[Bug c++/54580] 64-bit pointer to int cast fails
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Sep 15 17:53:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54580
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-09-15 17:52:43 UTC ---
That explicit type conversion (i.e. cast) is equivalent to
reinterpret_cast<int>("") and the standard says reinterpret_cast can be used to
convert a pointer to an integer type large enough to hold it. The code is
invalid and should be rejected by any 64-bit C++ compiler, just as (short)""
should be by 32-bit compilers.
More information about the Gcc-bugs
mailing list