The only other solution we've found (that doesn't conflict with other rules) is to declare and initialise a struct with the members set to the required values. e.g.
Code: Select all
void f (void)
{
struct FOO
{
int Index;
int Result;
} ;
for (FOO Test = {0, 0}; Test.Index < 10; Test.Index++)
{
Test.Result += SomeTestFunction( );
if (Test.Result > 5)
{
break;
}
}
}