c++ - 如何识别大型 C++ 非托管应用程序中的错误转换?

标签 c++ windows visual-studio

该应用程序有数千个类。 我想通过正则表达式将所有 c 风格的转换转换为动态转换,但我失败了,因为很难识别转换的参数表达式。

我正在使用 VS2010(但在 VS 2008 上也有一个现成的以前版本)

您知道存在执行转换检查的工具吗?

感谢任何提示

最佳答案

g++ 有一个选项,当启用时,它会打印出 c 风格转换的警告。

-Wold-style-cast (C++ and Objective-C++ only)

Warn if an old-style (C-style) cast to a non-void type is used within a C++ program. The new-style casts (dynamic_cast, static_cast, reinterpret_cast, and const_cast) are less vulnerable to unintended effects and much easier to search for.

关于c++ - 如何识别大型 C++ 非托管应用程序中的错误转换?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5727213/

相关文章:

c++ - 如何传递 unique_ptr<T> 代替原始 *output* 指针参数?

c++ - 派生和破坏封装,还是违反 DRY?

C内存题

windows - for/f "the system cannot find the file"在 windows 命令脚本中

c++ - 项目依赖顺序 - VS2013

c# - 编辑javascript文件后需要构建吗?

c++ - 生成组合/排列(v 符号上的 t 集)

c# - 如何在Windows C#中以多个连续模式插入字符串

javascript - Visual Studio 2013 JSLint 验证?

c++ - winsock客户端和服务器通信