c++ - clang-modernize 可以更新 Windows/MFC 代码库吗?

标签 c++ mfc clang

为了尝试将“override”关键字添加到我的代码库中,并且没有任何更好的选择,我尝试让 clang-modernize 更新我的源文件。最终,Windows header 中的各种安全宏会发出咔哒声。

clang-modernize -risk=safe -summary -add-override -include-from=Src\inc Src\AuditFile.cpp -- -std=c++11 -ISrc "-IC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" "-Ic:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include" "-IC:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include" -DWIN32 -D_WINDOWS -D_DEBUG -D_CRTDBG_MAP_ALLOC -D_UNICODE -DUNICODE -D_AFXDLL -D_DLL -fms-compatibility -fmsc-version=1000 -fcxx-exceptions -fexceptions -w -D_M_AMD64=1 -D_M_X64=1

第一个“编译”错误:

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h:366:9: error: unknown type name '__possibly_notnullterminated'
typedef __possibly_notnullterminated WCHAR *PNZWCH;
        ^

我想知道是否有人解决过这些问题,以及如何解决的。

最佳答案

我遇到这个问题有点晚了,但我已经看到了这个问题。 确保包含所有包含目录。并且系统包含不应与 -I 一起使用,而应与 -isystem 一起使用。

希望对您有所帮助。

关于c++ - clang-modernize 可以更新 Windows/MFC 代码库吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31196345/

相关文章:

c++ - (C++) 在 fstream 中搜索截断字符

c++ - 基类与模板与生成的代码与宏的代码

c++ - 如何在 MFC C++ 中开始使用线程编程?

c++ - CPoint 只保存点 x 和 y 的整数值?备择方案?

c++ - 将 `nullptr` 分配给 `bool` 类型。哪个编译器是正确的?

c++ - QuickSort 不排序数组

c++ - C++中的数据库问题

c++ - 为什么我的鼠标光标坐标突然缩放?

clang - 我遇到了此错误消息 : 'regparm' is not valid on this platform

c++ - 使用 cmake 传递复合编译器选项