[sv-bc] Ambiguous declaration / initialization in for-loop

From: Chris Spear <Chris.Spear_at_.....>
Date: Fri Oct 28 2005 - 10:40:41 PDT
In section 10.5.2 "Enhanced for-loop", an example is shown where control variables can be locally declared or initialized:

	for ( int count = 0, done = 0, j = 0; j * count < 125; j++, count++)
		$display("Value j = %d\n", j );
	"In a for loop initialization, either all or none of the control variables 
	are locally declared. In the second loop of the last example, count, done 
	and j are all locally declared."

How do we differentiate between variables that get declared and those that just get initialized?  In this example, why are "done" and "j" locally declared?  What if I already had a "done" declared in this scope - would a new variable be declared?

A customer asked me for a much-needed clarification.

Thanks!

/*********************************************************   
Chris Spear              Verification Specialist             
Synopsys, Inc.           Phone 508-263-8114      ..  __@     
377 Simarano Drive       Fax   508-263-8123        _`\<,_    
Marlboro, MA 01752 USA   Cell  508-254-7223    .. (*)/ (*)   
Spear_ f rom _Synopsys.com       http://Chris.Spear.net              
*********************************************************/  
Received on Fri Oct 28 10:40:50 2005

This archive was generated by hypermail 2.1.8 : Fri Oct 28 2005 - 10:44:46 PDT