该应用程序有数千个类。 我想通过正则表达式将所有 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/