www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - volatile inconsistency

reply "The Dr ... who?" <matthew.hat stlsoft.dot.org> writes:
    for(int i = 0; i < 10000000; )
    {
        volatile ++i;
    }

is legal

    for(int i = 0; i < 10000000;   volatile ++i)
    {
    }

is not
Jun 11 2004
parent "Walter" <newshound digitalmars.com> writes:
"The Dr ... who?" <matthew.hat stlsoft.dot.org> wrote in message
news:cae9ab$12md$1 digitaldaemon.com...
     for(int i = 0; i < 10000000; )
     {
         volatile ++i;
     }

 is legal

     for(int i = 0; i < 10000000;   volatile ++i)
     {
     }

 is not

That's correct. Volatile is the start of a statement, the third part of a for statement is an expression, not a statement.
Jul 06 2004