Muokkaa

Jaa


Compiler Error C3012

'intrinsic' : intrinsic function not allowed directly within a parallel region

A compiler intrinsic function is not allowed in an omp parallel region. To fix this issue, move intrinsics out of the region, or replace them with non-intrinsic equivalents.

Example

The following sample generates C3012, and shows one way to fix it:

// C3012.cpp
// compile with: /openmp
#ifdef __cplusplus
extern "C" {
#endif
void* _ReturnAddress();
#ifdef __cplusplus
}
#endif

int main()
{
   #pragma omp parallel
   {
      _ReturnAddress();   // C3012
   }
   _ReturnAddress();      // OK
}