[ROOT] CINT C++ ext. warning

From: Anton Fokin (anton.fokin@smartquant.com)
Date: Thu Feb 14 2002 - 15:48:40 MET


Hi guys,

I spent a couple of days trying to figure out why my server side script
doesn't work.

{
TStock Stock = gDataManager->GetStock("SUNW_US");
}

has a typo, it should be TStock *Stock ...because gDataManager->....
returns a POINTER to a stock object.

It works fine in CINT producing no warnings/errors but what it actually
does is horrible:

- it creates new Stock object
- it calls copy constructor to copy SUNW_US stock to this object, so
that this new SUNW_US object gets registered in the datamanager and old
object gets lost
- after macro execution it deletes Stock object, removing its reference
from datamanager

Well, you should not read or understand all those details about R-Quant
stuff but I just wanted to demonstrate how CINT C++ extension leads to a
chain of catastrophic events....

Is it good in general to have such possibility?

Cheers,
Anton



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:41 MET