There is another option to mix compilation models within a single source file that is also not recommended—functions that use Visual C++ language features that cannot be mapped to IL code are automatically compiled to native code. Code that uses inline assembly, like the one following, is an obvious example for code that is not mappable:
Since the IL instruction set does not know about the eax register, the complier cannot map these instructions to IL instructions. A few other language features of Visual C++ cannot be mapped to IL, either. These include setjmp, longjmp, and processor intrinsics like _ReturnAddress and _AddressOfReturnAddress. When the compiler automatically switches to the native compilation model, it reports warning 4793. You should handle this warning by moving the function to a source file that is compiled to native code.
Was this article helpful?