C ++ / CLI中是否有C#的不安全等效项? [英] Is there a C#'s unsafe equivalent in C++/CLI?

查看:55
本文介绍了C ++ / CLI中是否有C#的不安全等效项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将C ++ / CLI代码移植到可验证的类型安全的C ++ / CLI代码(使用clr:safe标志)中,以便获得AnyCPU程序集。
我发现的主要编译问题是,我遇到很多C4956错误,我认为可以通过明确告诉编译器我希望这是不安全的来解决。
建议?

I am trying to port C++/CLI code into Verifiable Type-Safe C++/CLI code (Use clr:safe flag) so I can get a AnyCPU assembly. The main compilation problem I find is that, I get a lot of C4956 errors and I think, that might be solved by explicitly tell the compiler I expect this to be unsafe. Suggestions?

推荐答案

此处

基本上,这正是 / clr:pure 应该提供的,因为它还会生成一个纯MSIL程序集。不幸的是,它仍然导致对特定位数的依赖,因此与 AnyCPU 不兼容。

Basically, this is what /clr:pure was supposed to provide, because it also generates a pure MSIL assembly. Unfortunately it still causes a dependency on a particular bitness, so isn't compatible with AnyCPU.

这篇关于C ++ / CLI中是否有C#的不安全等效项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆