英特尔 C++ 是否可以?编译器有边界检查吗?

发布于 2024-09-30 02:12:38 字数 80 浏览 3 评论 0原文

我想知道,Intel C++ 编译器是否有可用的边界检查?十年来,我正在处理大量不断发展的代码,并且迫切需要调试和重构。我需要任何我能得到的帮助。

I was wondering, does Intel C++ compiler have bounds checking available? I am working with tons of code evolving for ten years now, and in desperate need for debugging and refactoring. I need any help I can get.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你爱我像她 2024-10-07 02:12:38

英特尔的编译器有多个边界检查选项。例如

,检查指针、Qcheck-pointers 确定编译器是否通过指针检查内存访问的边界。

http://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-35036DDA-62B4-402F-8A21-1201C2706BF3.htm

Intel's compiler has several bounds checking options. E.g.

check-pointers, Qcheck-pointers Determines whether the compiler checks bounds for memory access through pointers.

http://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-35036DDA-62B4-402F-8A21-1201C2706BF3.htm

陪你搞怪i 2024-10-07 02:12:38

C 数组从根本上就是这样被破坏的,你无法可靠地对它们进行边界检查。编译器也不能。然而,Intel 的 C++ 编译器当然可以编译向量类。打开迭代器调试,使用 at() 访问器。

C arrays are fundamentally broken this way, you cannot reliably bounds-check them. Nor can the compiler. Intel's C++ compiler however certainly can compile the vector class. Turn on iterator debugging, use the at() accessor.

倾城泪 2024-10-07 02:12:38

如果您使用的是 Linux 或 OS X,valgrind 可以帮助您查找与内存访问相关的错误。它不支持 C++,因此将其输出与您的代码相匹配可能需要一些工作。

If you are working on Linux or OS X, valgrind can help you find memory access related errors. It's not C++ aware, so matching its output with your code may take a little work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文