Re: problem with a Boolean

From: Rutger van der Eijk (r36@nikhef.nl)
Date: Tue Mar 07 2000 - 13:04:15 MET


Hi,

> bRichCalNrLeaves is not declared in the scope of the offending line,
> regardless of the value of kRichCal. The CINT error message does not
seem
> to be wrong. In my opinion, the problem is the missing error message in
> case kRichCal==true.
>
> Christoph

At http://root.cern.ch/root/Cint.phtml?limitations I read:

+ Function scope
   Variables can be declared in global or function scope.
   Unlike ANSI, local variable has function scope. If a local variable is 
  once declared in a function, it will be alive until execution gets out 
  from the function even if it is declared within sub-block. In ANSI C,
local 
  variables have block scope.

        void func()
        {
          int i;
          for(i=0;i<10;i++) {
            int n;      /* block scope */
            printf("n=%d\\n",n++);
          }
          /* n is still alive here in cint, n should be already
          dead in ANSI C */ 

This explains why CINT does NOT give an error message if kRichCal==true.
However I still don't understand why Thomas DOES get an error message for
kRichCal==false. Maybe it is related to the problem I reported
http://root.cern.ch/root-bugs/Closed?id=544;expression=rutger;user=guest#followup6
(i.e. bug report 544). Masaharu?


Rutger



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