shibboleth-dev - Re: Linux update
Subject: Shibboleth Developers
List archive
- From: Derek Atkins <>
- To: Scott Cantor <>
- Cc:
- Subject: Re: Linux update
- Date: 11 Sep 2002 12:15:30 -0400
So in other words I should be able to safely dynamic_cast<> any
of my own objects, but I may need to work around times where I
cast a SAML or Shib object. What about when I use a saml object's
clone() method -- is that safe to dynamic_cast<> back to itself?
-derek
Scott Cantor
<>
writes:
> > This implies that all uses of dynamic_cast<> are subject to
> > this bug, eh? That means I need to fix my code as well.
>
> I think it's probably possible to use it in some contexts, mostly if
> you're within the same body of code that built the object and would have
> implemented the RTTI supporting code. It also appears to be safe in
> executables that are totally linked in advance.
>
> It seems to come up more in cases where you write one library that casts
> an object implemented in a second library, so any casting of SAML
> objects down would most likely break.
>
> > Where is it safe and where is it not safe to use C-casts?
>
> Any time you really know the pointer's real type, you're safe, barring
> unforeseen errors. OTOH, if for example you have a collection of common
> objects (say, oh, an assertion's statements) with no way to know what
> type of statement each one is, there's no possible way to make it safe.
> You simply act like you're in C, and you stick additional functions or
> data in to tell you what the story is. That's all dynamic_cast and
> typeinfo are anyway, but the compiler does it for you.
>
> -- Scott
>
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
PGP key available
------------------------------------------------------mace-shib-design-+
For list utilities, archives, subscribe, unsubscribe, etc. please visit the
ListProc web interface at
http://archives.internet2.edu/
------------------------------------------------------mace-shib-design--
- Linux update, Scott Cantor, 09/11/2002
- Re: Linux update, Derek Atkins, 09/11/2002
- RE: Linux update, Scott Cantor, 09/11/2002
- Re: Linux update, Derek Atkins, 09/11/2002
- RE: Linux update, Scott Cantor, 09/11/2002
- Re: Linux update, Derek Atkins, 09/11/2002
- RE: Linux update, Scott Cantor, 09/11/2002
- Re: Linux update, Derek Atkins, 09/11/2002
- RE: Linux update, Scott Cantor, 09/11/2002
- Re: Linux update, Derek Atkins, 09/11/2002
- RE: Linux update, Scott Cantor, 09/11/2002
- Re: Linux update, Derek Atkins, 09/11/2002
Archive powered by MHonArc 2.6.16.