能否在 Visual Basic 2008 中禁用数组边界检查
我知道这是 Visual Studio 早期版本中的高级编译器选项,有没有办法在 Visual Studio 2008 中禁用数组边界检查?我看不到任何选项。
I know that this was an advanced compiler option in previous versions of Visual Studio, is there a way to disable array bounds checking in Visual Studio 2008? There's no option for it that I can see.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,那不可能。在 C/C++ 中没有进行数组边界检查是 Microsoft 陷入恶意软件困境的原因。这在托管代码中是禁忌。如果 JIT 编译器可以检测到开始索引和结束索引在边界内,则 For 和 For Each 循环将在不进行边界检查的情况下运行。这是 For 循环“TO”值仅计算一次的原因之一。
No, that's not possible. Not having array bound checking in C/C++ is how Microsoft got into such deep trouble with malware. It is a no-no in managed code. For and For Each loops will run without bound checking if the JIT compiler can detect that the begin- and end-indices are within bounds. This is one of the reasons that the For loop "TO" value is only evaluated once.