Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 May 1997 23:35:42 -0700
From:      Amancio Hasty <hasty@rah.star-gate.com>
To:        freebsd-hackers@FreeBSD.ORG (FreeBSD hackers)
Subject:   Re: g++ shared library segfaults 
Message-ID:  <199705100635.XAA01088@rah.star-gate.com>
In-Reply-To: Your message of "Sat, 10 May 1997 06:33:49 %2B0200." <19970510063349.ZO50925@uriah.heep.sax.de> 

next in thread | previous in thread | raw e-mail | index | archive | help
You are right thats not illegal . Care to try out doc to find out 
whats wrong ? 8)

Hint:
{
<no previous definition of i>

	for (long i = 0....) { // first definition of "i"
	}


<Any reference to "i" from this point on is outside the scope of the
definition i.>

<for instance the following reference to "i" is illegal>
	 var.ref(i)

}

	Regards,
	Amancio

>From The Desk Of J Wunsch :
> As Amancio Hasty wrote:
> 
> > I traced it further more and it looks like a bug in Docviewer.c using 
> > an illegal reference to a local variable.
> > 
> >  for (long i = 0; i < count; ++i) {
> >         ViewerColorInfo& info = _color_info->item_ref(i);
> >         if (strcmp(info._name, name) == 0) {
> >             break;
> >         }
> >     }
> > 
> > later on it checks the value of i.
> 
> That's not illegal.  The scope of i is inside the current block (at
> the same level where the stuff is you've been quoting), from the line
> with the `for' loop, to the end of that block.
> 
> -- 
> cheers, J"org
> 
> joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
> Never trust an operating system you don't have sources for. ;-)





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705100635.XAA01088>