[Interest] dynamic_cast failing

Scott Aron Bloom scott at towel42.com
Sat Apr 11 18:57:19 CEST 2015



-----Original Message-----
From: interest-bounces+scott.bloom=onshorecs.com at qt-project.org [mailto:interest-bounces+scott.bloom=onshorecs.com at qt-project.org] On Behalf Of René J.V. Bertin
Sent: Saturday, April 11, 2015 9:28 AM
To: interest at qt-project.org
Cc: Nikos Chantziaras
Subject: Re: [Interest] dynamic_cast failing

On Saturday April 11 2015 18:31:38 Nikos Chantziaras wrote:

Thanks,

>You might be hitting some undefined behavior. Do your classes have 
>virtual functions? If not, dynamic_cast can fail, as it's only supposed 
>to work with polymorphic classes.

I'll have a look; it's not my own code, I'm just hunting down whatever bug causes this cast to fail (and as a result crash the app because failure isn't handled).

However, your suggestion would cause the dynamic_cast to fail everywhere, not just on OS X, right? It seems a bit far-fetched to disable virtual destructors on OS X ...

R.
_______________________________________________

Its my understanding, its undefined behavior....



More information about the Interest mailing list