public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Alternative of dynamic_cast
@ 2004-01-02 11:36 Jyotirmoy Das
  2004-01-02 11:57 ` Falk Hueffner
  2004-01-02 12:15 ` mramirez
  0 siblings, 2 replies; 6+ messages in thread
From: Jyotirmoy Das @ 2004-01-02 11:36 UTC (permalink / raw)
  To: gcc-help

  
  Hi All,
  Is there any alternative of dynamic_cast on the following platform:
  gcc version: 2.96
  platform : Red Hat Linux Advanced Server release 2.1AS.
	
	I don't want to use dynamic_cast. Is there any alternative of dynamic_cast which has the same functionality ? Or any pointer to write the implementation of dynamic_cast in  class or as global function ?

  Thanks,
  Jyotirmoy Das
  das_jyotirmoy@infosys.com


	

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Alternative of dynamic_cast
  2004-01-02 11:36 Alternative of dynamic_cast Jyotirmoy Das
@ 2004-01-02 11:57 ` Falk Hueffner
  2004-01-02 12:15 ` mramirez
  1 sibling, 0 replies; 6+ messages in thread
From: Falk Hueffner @ 2004-01-02 11:57 UTC (permalink / raw)
  To: Jyotirmoy Das; +Cc: gcc-help

"Jyotirmoy Das" <Jyotirmoy_Das@infosys.com> writes:

> I don't want to use dynamic_cast. Is there any alternative of
> dynamic_cast which has the same functionality ?

No.

> Or any pointer to write the implementation of dynamic_cast in class
> or as global function ?

Not possible in a portable way. Why not just use dynamic_cast?

-- 
	Falk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Alternative of dynamic_cast
  2004-01-02 11:36 Alternative of dynamic_cast Jyotirmoy Das
  2004-01-02 11:57 ` Falk Hueffner
@ 2004-01-02 12:15 ` mramirez
  1 sibling, 0 replies; 6+ messages in thread
From: mramirez @ 2004-01-02 12:15 UTC (permalink / raw)
  To: Jyotirmoy Das; +Cc: gcc-help

>
>   Hi All,
>   Is there any alternative of dynamic_cast on the following platform:
>   gcc version: 2.96
>   platform : Red Hat Linux Advanced Server release 2.1AS.
>
> 	I don't want to use dynamic_cast. Is there any alternative of
> dynamic_cast which has the same functionality ? Or any pointer to write
> the implementation of dynamic_cast in  class or as global function ?
>

Why do you need a dynamic_cast? Sometimes the use of dynamic_cast'ing
points to a poor interface... there are usually workarounds to
dynamic_casting.

However, maybe the *simpler* (i.e. to not touch the sources) approach
would be to "downgrade" your system to gcc-2.95.*. C++ ABI is the same,
and it's a rock-solid  compiler, albeit a bit outdated. However, if
extensive relinking and redeployment is not an issue, then you might
choose one of the gcc 3.3 series compilers.

Miguel.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Alternative of dynamic_cast
       [not found] ` <2B721C6525F0D411B1E900B0D0226BDD023EAAD7@mohmsg01.ad.infos ys.com>
@ 2004-01-05 17:40   ` Andrea 'Fyre Wyzard' Bocci
  0 siblings, 0 replies; 6+ messages in thread
From: Andrea 'Fyre Wyzard' Bocci @ 2004-01-05 17:40 UTC (permalink / raw)
  To: Jyotirmoy Das; +Cc: Falk Hueffner, gcc-help

At 17:48 02/01/2004 (GMT +0530), Jyotirmoy Das wrote:
>Actually there is symbol resolution problem with dynamic_cast between gcc 
>C++ runtime lib and libjvm. For this reason, my application crashes. The 
>libjmv.so provided by IBM is compiled with gcc 2.95 and my application is 
>running on gcc 2.96. I can't change libjvm or to downgrade the compiler 
>version of my application. As a result, application dumps the core at 
>runtime during the symbol resolution of dynamic_cast. So i need some 
>alternative of that.

Would it be possible to statically link the part of the gcc libary 
responsible for dynamic_cast? Or all the libgcc or whatever, actually ?
Maybe this could help.

.fwyzard. 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Alternative of dynamic_cast
  2004-01-02 12:21 Jyotirmoy Das
@ 2004-01-02 12:38 ` mramirez
       [not found] ` <2B721C6525F0D411B1E900B0D0226BDD023EAAD7@mohmsg01.ad.infos ys.com>
  1 sibling, 0 replies; 6+ messages in thread
From: mramirez @ 2004-01-02 12:38 UTC (permalink / raw)
  To: Jyotirmoy Das; +Cc: Falk Hueffner, gcc-help

> Actually there is symbol resolution problem with dynamic_cast between gcc
> C++ runtime lib and libjvm. For this reason, my application crashes. The
> libjmv.so provided by IBM is compiled with gcc 2.95 and my application is
> running on gcc 2.96. I can't change libjvm or to downgrade the compiler
> version of my application. As a result, application dumps the core at
> runtime during the symbol resolution of dynamic_cast. So i need some
> alternative of that.
>

Well, if there is no possibility for the cast to fail - which can be quite
a risky assumption - you might try static_cast. However, as dynamic_cast
impl on the RH distribution of gcc-2.96 was quite broken, maybe
static_cast impl is also broken.

Good luck!

Miguel.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Alternative of dynamic_cast
@ 2004-01-02 12:21 Jyotirmoy Das
  2004-01-02 12:38 ` mramirez
       [not found] ` <2B721C6525F0D411B1E900B0D0226BDD023EAAD7@mohmsg01.ad.infos ys.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Jyotirmoy Das @ 2004-01-02 12:21 UTC (permalink / raw)
  To: Falk Hueffner; +Cc: gcc-help

Actually there is symbol resolution problem with dynamic_cast between gcc C++ runtime lib and libjvm. For this reason, my application crashes. The libjmv.so provided by IBM is compiled with gcc 2.95 and my application is running on gcc 2.96. I can't change libjvm or to downgrade the compiler version of my application. As a result, application dumps the core at runtime during the symbol resolution of dynamic_cast. So i need some alternative of that.

-----Original Message-----
From: Falk Hueffner [mailto:falk.hueffner@student.uni-tuebingen.de]
Sent: Friday, January 02, 2004 5:27 PM
To: Jyotirmoy Das
Cc: gcc-help@gcc.gnu.org
Subject: Re: Alternative of dynamic_cast


"Jyotirmoy Das" <Jyotirmoy_Das@infosys.com> writes:

> I don't want to use dynamic_cast. Is there any alternative of
> dynamic_cast which has the same functionality ?

No.

> Or any pointer to write the implementation of dynamic_cast in class
> or as global function ?

Not possible in a portable way. Why not just use dynamic_cast?

-- 
	Falk

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-01-05 17:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-02 11:36 Alternative of dynamic_cast Jyotirmoy Das
2004-01-02 11:57 ` Falk Hueffner
2004-01-02 12:15 ` mramirez
2004-01-02 12:21 Jyotirmoy Das
2004-01-02 12:38 ` mramirez
     [not found] ` <2B721C6525F0D411B1E900B0D0226BDD023EAAD7@mohmsg01.ad.infos ys.com>
2004-01-05 17:40   ` Andrea 'Fyre Wyzard' Bocci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).