Export (0) Print
Expand All
Expand Minimize
0 out of 13 rated this helpful - Rate this topic

Compiler Warning (level 1 and 3) C4793

Error Message

'reason' : causes native code generation for function 'function'

function was compiled to unmanaged, native code, even though the file was compiled /clr. The compiler will not be able to create an MSIL version of the function if the function includes setjmp, inline assembly, or a parameter list that includes a variable number of parameters.

This is a level 1 warning when compiling with /clr:pure.

Example

The following sample generates C4793.

// C4793.cpp
// compile with: /clr /W3 /c
// processor: x86
int asmfunc(void) {   // C4793, compiled as unmanaged, native code
   __asm {
      mov eax, 0
   }
}

The following sample generates C4793.

// C4793_b.cpp
// compile with: /clr:pure /WX
#include <setjmp.h>
jmp_buf test_buf;

void f() {
   setjmp(test_buf)   // C4793 warning
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.