I am working with Balaji in the GCC implementation of CilkPlus, and I have a few syntax questions. I am looking at version 1.1 of the language extension specification. BTW, if this is not the right forum to ask about standards/syntax questions, please let me know where I may direct such questions.
For _Cilk_for (and similarly for the for loop associated with a #pragma simd), I see:
1. "No storage class may be specificed for the variable within the initialization clause.". I assume static, extern, and globals are not allowed, but "auto" variables are allowed? It is not clear from the spec, since auto is also a storage class.
2. There is no talk of casts in the conditional expression in a _Cilk_for. Can I assume they are disallowed?:
_Cilk_for (c=0; (int)c < 1234; ++c) // Can we assume this cast is disallowed?
3. The grammar expression "shift-expression" is used but never formally defined. Is this defined in another document?
4. In the description for #pragma simd, the grammar expression "conditional-expression" is similarly not defined.
5. The specs say "the total number of iterations (loop count) can be determined before beginning the loop execution" and later "the increment and limit expressions may be evaluated fewer times than in the serialization". Does this mean I can safely hoist any increment or limit expressions before the loop. That is, rewrite this:
_Cilk_for(i=0; i < foo(); i += bar())
tmp1 = foo();
tmp2 = bar();
_Cilk_for(i=0; i < tmp1; i+= tmp2)
Could someone please clarify all this?