semantics of C++ casts

Marc Espie espie@quatramaran.ens.fr
Fri Nov 20 17:31:00 GMT 1998


In article < Pine.GSO.3.95k.981120175851.12070A-100000@hegel > you write:
>It's not a different class per se, it's a derived class.  Also, the code
>works on CC (SUN's) 4.2 as well as Portland Groups compiler.

Yes, so ?
Just because it happens to work on a different compiler doesn't mean it's
standard nor should be supported. reinterpret_cast<> and vtables -> anything
goes. 

Do you have a longer fragment that would show why you need to use 
reinterpret_cast ?  From what you've posted, it just looks like you're 
cutting corners by not calling dynamic_cast<> where you should, and that
Sun's CC is letting you off awfully easy.



More information about the Gcc-bugs mailing list