Visual Studio 2017的自定义C ++代码检查器 [英] Custom C++ code checker for Visual Studio 2017

查看:104
本文介绍了Visual Studio 2017的自定义C ++代码检查器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我见过Microsoft现在已经发布了Visual Studio 2017的RC。我知道这个版本带有一些增强的静态代码分析,根据C ++核心指南检查代码。< a href ="https://blogs.msdn.microsoft.com/vcblog/2016/10/12/cppcorecheck/\"rel ="nofollow noreferrer">

似乎像这些检查被实现为Visual Studio的某种扩展。如果我们能够使用Visual Studio 2017为我们自己的指南编写自己的代码分析器/实现检查器,这就提出了一个问题吗?

Seems like these checks are implemented as some kind of extension to Visual Studio. This raises the question if we will able to write our own code analyzers / implement checkers for our own guidelines with Visual Studio 2017?

到目前为止,我们不得不使用一些外部编译器(如clang)来生成AST。我只能找到VS2015的文档,描述如何为C#等托管语言编写自定义检查器。

So far we had to use some external compiler (like clang) to generate the AST. I could only find documentation for VS2015, describing how to write custom checkers for managed languages like C#.

推荐答案

嗨The-G,

Hi The-G,

感谢您在此处发布。

>>似乎这些检查是作为Visual Studio的某种扩展实现的。如果我们能够使用Visual Studio 2017为我们自己的指南编写自己的代码分析器/实现检查器,这就提出了一个问题吗?

用于执行
C ++ Core的C ++核心检查程序指南
现在随Visual Studio一起分发。只需在项目属性页面的"代码分析扩展"对话框中启用检查器,并在运行代码分析时包含扩展名。

The C++ Core Checkers for enforcing the C++ Core Guidelines are now distributed with Visual Studio. Simply enable the checkers in the Code Analysis Extensions dialog in the project's property pages and the extensions will be included when you run code analysis.

有关详细信息,请参阅以下文档。

For more information, please refer to this document below.

https://docs.microsoft.com/en-us/cpp/top/what-s -new-for-visual-cpp-in-visual-studio

希望这可以帮助你。

最好的问候,$
Sera Yu


这篇关于Visual Studio 2017的自定义C ++代码检查器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆