编译器错误 C3013

“clause”:子句在 OpenMP“directiv”指令上只能出现一次

子句在同一指令上出现了两次。 删除子句的一次出现。

以下示例生成 C3013:

// C3013.cpp
// compile with: /openmp
int main() {
   int a, b, c, x, y, z;

   #pragma omp parallel shared(a,b,c) private(x)

   #pragma omp for nowait private(x) nowait   // C3013
   // The previous line generates C3013, with two nowait clauses
   // try the following line instead:
   // #pragma omp for nowait private(x)
   for (a = 0 ; a < 10 ; ++a) {
   }
}