RE:Re: [ROOT] A littel macro and a bug

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Sat Aug 26 2000 - 04:01:31 MEST


Hello Patois and Fons,

Thank you for the bug report. This was a bug of cint with
bytecode compiler.

to fix the problem, I want to change the behavior of 
implicitly declared class pointer as follows.

 - When undeclared object pointer appears in macro or
   command line, it is allocated in global scope.
 - When undeclared object pointer appears in a C/C++
   function, it is allocated in local scope. 

So, in this case, 'p' becomes local to the function.
Your example works fine with this change.

Fons, Does this look OK with old macros?

Thank you
Masaharu Goto


>Date: Thu, 24 Aug 2000 19:11:49 +0200 (CEST)
>From: "Patois Yannick" <patois@ganil.fr>
>To: Fons Rademakers <Fons.Rademakers@cern.ch>
>Cc: ROOT mailing list <roottalk@pcroot.cern.ch>,
>    Masaharu Goto <MXJ02154@niftyserve.or.jp>
>Subject: Re: [ROOT] A littel macro and a bug
>
>On Thu, 24 Aug 2000, Fons Rademakers wrote:
>
>> Hi Yannick, 
>>    CINT seems to get confused by the fact that "p" has not been declared
>> properly (while not complaining about it, which is a CINT extension).
>> 
>> Change:
>>    p = new  TPad("a","b",.1,.1,.9,.9);
>> to
>>    TPad *p = new  TPad("a","b",.1,.1,.9,.9);
>> 
>> and the problem is solved.
>
>
>Thanx a lot, the original problem was a little bit more complex, but the
>solution was the same.
>
>Is there a way to disable this 'extension' ? Unfortunately, it's not the
>first time I lose too much time on this pecular behavior of CINT.
>
>At least a warning could be issued... It seems that if the expression is
>not very simple, the implicit declaration of variables is very likely to
>prevent the macro to run (and the worse is that no clear message neither
>line number is given...).
>
>       Yannick
>
>
>



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:32 MET