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

From: Arturo Salz <Arturo.Salz_at_.....>
Date: Fri Oct 28 2005 - 15:57:09 PDT
My understanding of the LRM is that it is consistent with your 
idea of following C++. Thus:

   for (count = 0, done = 0; ...		// legal

   for (int count = 0, done = 0; ...		// legal

   for (count = 0, int done = 0; ...		// error

	Arturo

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Paul
Graham
Sent: Friday, October 28, 2005 1:45 PM
To: sharp@cadence.com
Cc: sv-bc@eda.org; Chris.Spear@synopsys.COM
Subject: Re: [sv-bc] Ambiguous declaration / initialization in for-loop

> There may still be a problem here.  What happens with
> 
> 	for (count = 0, int done = 0; !done; count++)
> 	
> The rule about "all or none" means that the declaration of done
requires

I think I made a suggestion a while back that SV should
match the C++ syntax (or at least the g++ implementation)
which allows a optional type declaration immediately after
the '('.  So 

    for (count = 0, done = 0; ...

and

    for (int count = 0, done = 0; ...

are both legal, but 

    for (count = 0, int done = 0; ...

is not.  Does the SV syntax allow this last example?

Paul
Received on Fri Oct 28 15:57:18 2005

This archive was generated by hypermail 2.1.8 : Fri Oct 28 2005 - 15:58:27 PDT