# Curly bracket counting in 5.17.03

**URL:** <https://root-forum.cern.ch/t/curly-bracket-counting-in-5-17-03/5639>\
**Category:** ROOT\
**Created:** [November 16, 2007, 8:30am UTC](https://root-forum.cern.ch/t/curly-bracket-counting-in-5-17-03/5639 "2007-11-16T08:30:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbrandt](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/258eb7/32.png) [@gbrandt](https://root-forum.cern.ch/u/gbrandt)\
**Post date:** [November 16, 2007, 8:30am UTC](https://root-forum.cern.ch/t/curly-bracket-counting-in-5-17-03/5639/1 "2007-11-16T08:30:58Z")

</div>

Hi,

The very short macro below reports  
Error: Too many '}'  
in line 19?

the problem appears in 5.17.03,  
there is no problem in 5.16.00.  
I checked the commits for 5.17.04 but only found a fix  
related to ‘dangling parentheses’ which is probably not the  
issue here?

Thanks,  
Gerhard

```auto
{
  Int_t nlines = 10;
  Int_t ntypesmax = 50;
  Int_t condition1 = 0;
  Int_t condition2 = 1;

  for (Int_t i = 0; i < nlines - 1; i++) {
    Int_t StringExists = 0;
    for (Int_t j = 0; j < ntypesmax; j++) {
      if (condition1) {
	StringExists = 1;
      }
    }
    if (StringExists) {
      continue;
    } else {
      for (Int_t j = 0; j < ntypesmax; j++) {
	if (condition2) {
	  break;
	}
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [November 16, 2007, 10:53am UTC](https://root-forum.cern.ch/t/curly-bracket-counting-in-5-17-03/5639/2 "2007-11-16T10:53:59Z")

</div>

Hi Gerhard,

I can reproduce it; I’m debugging it. Thanks SO much for reporting - what a horrible bug! I’ll let you know when it’s fixed.

Axel.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [November 16, 2007, 4:44pm UTC](https://root-forum.cern.ch/t/curly-bracket-counting-in-5-17-03/5639/3 "2007-11-16T16:44:59Z")

</div>

Hi,

this is a bit more complex than I was hoping. It’s a side effect of CINT’s efforts to optimize the code; if you type “.O0” before running the script it will succeed. I will _try_ to fix it for the production release in December.

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [May 22, 2008, 1:46pm UTC](https://root-forum.cern.ch/t/curly-bracket-counting-in-5-17-03/5639/4 "2008-05-22T13:46:13Z")

</div>

Hi Gerhard,

this has been fixed.

Cheers, Axel.
