Enable C++ compiler warning for missing XML documentation
When XML documentation is enabled for my C++ projects (managed) the compiler does not raise any warnings for missing comments.
I have enabled the documentation generation by setting "Generate XML documentation Files" (/doc) to true as described here. The project is configured as a dynamic library with /clr and warning level 4 (/W4).
For C# projects the compiler raises a Missin开发者_JAVA百科g XML comment for publicly visible type or member 'Type_or_Member' warning when comments are missing. To force the developers to make the appropriate comments I would like to have the same behavior for the C++ projects. How do I obtain that?
The VC++ XML comments are not processed the say way as for .NET. The VC++ compiler processes the comments and generates .xdc files which are later assembled by a tool called xdcmake.exe into xml files. However, there is no option to tell the compiler to issue warnings if XML comments as known to .NET are missing.
(See http://msdn.microsoft.com/en-us/library/ms177227.aspx and http://msdn.microsoft.com/en-us/library/ms177247.aspx)
精彩评论