OpenMP® Forum

Discussion on the OpenMP specification run by the OpenMP ARB. OpenMP and the OpenMP logo are registered trademarks of the OpenMP Architecture Review Board in the United States and other countries. All rights reserved.

So should it allow for(int i = 0; i != 10; i++) for example? we know before hand that will be 10 iterations.

No, perhaps you should take a look at the OpenMP Spec. (original text formatting not maintained in this copy):

The for directive places restrictions on the structure of all associated for-loops.Specifically, all associated for-loops must have the following canonical form:for (init-expr; test-expr; incr-expr) structured-blockinit-expr One of the following:var = lbinteger-type var = lbrandom-access-iterator-type var = lbpointer-type var = lbtest-expr One of the following:var relational-op bb relational-op varincr-expr One of the following:++varvar++--varvar--var += incrvar -= incrvar = var + incrvar = incr + varvar = var - incrvar One of the following:A variable of a signed or unsigned integer type.For C++, a variable of a random access iterator type.For C, a variable of a pointer type.If this variable would otherwise be shared, it is implicitly madeprivate in the loop construct. This variable must not bemodified during the execution of the for-loop other than inincr-expr. Unless the variable is specified lastprivate onthe loop construct, its value after the loop is unspecified.relational-op One of the following:<<=>>=lb and b Loop invariant expressions of a type compatible with the typeof var.incr A loop invariant integer expression.