Posts: 632
Threads: 18
Joined: Jan 2006
Reputation:
1
In the TC, we allow the for loop example with all three expressions being empty for a deliberate infinite loop.
Code:
/* deliberate infinite loop */
for ( ; ; )
{
...
}
Posted by and on behalf of the MISRA C Working Group
Posts: 8
Threads: 5
Joined: Apr 2007
Reputation:
0
Yes I saw that it was allowed. Is while (1==1) also allowed? Which is preferred?
George Brown
Unregistered
Hi Jon,
Looks like \"they\" said
Code:
/* deliberate infinite loop */
for ( ; ; )
{
...
}
was the allowed form is infinite loops. Given one way to write them, there is no need for alternatives.
I was taught Pascal back in the early 80's, and would like to write this in the following form. C99 defines a \"boolean\" type, so MISRA-C3 could be different!
Code:
/* deliberate infinite loop */
while(true)
{
...
}
George