{"id":12645,"date":"2017-03-07T10:13:08","date_gmt":"2017-03-07T18:13:08","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=12645"},"modified":"2019-02-18T17:48:38","modified_gmt":"2019-02-18T17:48:38","slug":"c-code-analysis-improvements-in-visual-studio-2017-rtm","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/c-code-analysis-improvements-in-visual-studio-2017-rtm\/","title":{"rendered":"C++ Code Analysis improvements in Visual Studio 2017 RTM"},"content":{"rendered":"<p><em>This blog post was written by Sunny Chatterjee and Andrew Pardoe<\/em><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/visual-studio-2017-productivity-performance-and-partners\/\">Visual Studio 2017 RTM<\/a> \u00a0release <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/cppcorecheck\/\">includes the C++ Core Guidelines Checkers<\/a> as part of Code Analysis tools for C\/C++. We have gotten a ton of useful feedback on the early previews of these checks through our external customers. Thank you for engaging with us and giving us great feedback. This feedback helped us improve the quality of the final released version of \u00a0C++ Core Guidelines checks.\u00a0Some of these improvements are explained in detail in this <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=12655\">blog post about <code>const<\/code> correctness<\/a>.<\/p>\n<p>Besides shipping the C++ Core Guidelines checker, we also fixed \u00a0more than 150 bugs in our core analysis engine. All of these fixes are available in the Visual Studio 2017 RTM. As a result, developers should expect to see accuracy improvements in C++ code analysis. <em>Download Visual Studio 2017<\/em> today and let us know what you think of the improvements to code analysis!<\/p>\n<p>Here are some notable fixes that were frequently reported. These fixes were made as a result of direct external feedback.<\/p>\n<ol>\n<li><strong>False positive during dereferencing null-pointer checks (C6011)<\/strong>\n<ol>\n<li><a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/1645136\/c6011-occurs-const-cast-to-const-members-after-if-statement\">https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/1645136\/c6011-occurs-const-cast-to-const-members-after-if-statement<\/a><\/li>\n<li><a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/1981990\/inappropriate-analyzer-warning-when-casting-to-reference-in-constructor\">https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/1981990\/inappropriate-analyzer-warning-when-casting-to-reference-in-constructor<\/a><\/li>\n<li><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2556936\/static-analysis-c6011-warning-false-positive-in-short-circuited-conditionals\">http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2556936\/static-analysis-c6011-warning-false-positive-in-short-circuited-conditionals<\/a><\/li>\n<li><a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2750342\/static-analysis-false-positive-when-using-a-bracketed-ternary-operator\">https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2750342\/static-analysis-false-positive-when-using-a-bracketed-ternary-operator<\/a><\/li>\n<li><a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/3078125\/false-positive-dereferencing-null-pointer-warning-when-taking-a-named-reference\">https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/3078125\/false-positive-dereferencing-null-pointer-warning-when-taking-a-named-reference<\/a><\/li>\n<li><a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/3082362\/static-analysis-false-positive-when-comparing-ptr-nullptr-vs-simply-ptr\">https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/3082362\/static-analysis-false-positive-when-comparing-ptr-nullptr-vs-simply-ptr<\/a><\/li>\n<\/ol>\n<\/li>\n<li><strong>False positive during uninitialized memory checks (C6001)<\/strong>\n<ol>\n<li><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/1858404\/false-positive-in-c-static-analysis-c6001\">http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/1858404\/false-positive-in-c-static-analysis-c6001<\/a><\/li>\n<li><a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2607792\/erroneous-report-from-sal\">https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2607792\/erroneous-report-from-sal<\/a><\/li>\n<\/ol>\n<\/li>\n<li><strong>False positive around inconsistent annotation checking (C28252 and C28253)<\/strong>\n<ol>\n<li><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2053524\/wsutil-compiler-version-1-0095-creates-a-file-that-triggers-warnings-c28252-and-c28253-even-when-compiled-with-w0\">http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2053524\/wsutil-compiler-version-1-0095-creates-a-file-that-triggers-warnings-c28252-and-c28253-even-when-compiled-with-w0<\/a><\/li>\n<\/ol>\n<\/li>\n<li><strong>False positive during annotation parsing (C28285)<\/strong>\n<ol>\n<li><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2358718\/sal-analysis-warning-c28285-when-using-local-static-variables\">http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2358718\/sal-analysis-warning-c28285-when-using-local-static-variables<\/a><\/li>\n<\/ol>\n<\/li>\n<li><strong>False positive during strict type match checking (C28039)<\/strong>\n<ol>\n<li><a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2573764\/sal-false-positive-on-strict-type-match\">https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2573764\/sal-false-positive-on-strict-type-match<\/a><\/li>\n<\/ol>\n<\/li>\n<li><strong>False positive when checking for local vs. global declarations on enum classes (C6244)<\/strong>\n<ol>\n<li><a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/3101212\/incorrect-static-analysis-warning-of-enum-class-enumerators-hiding-other-declarations\">https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/3101212\/incorrect-static-analysis-warning-of-enum-class-enumerators-hiding-other-declarations<\/a><\/li>\n<\/ol>\n<\/li>\n<li><strong>MSBuild error MSB4018 during code analysis runs: The &#8220;MergeNativeCodeAnalysis&#8221; task failed unexpectedly<\/strong>\n<ol>\n<li><a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/3113987\/error-msb4018-the-mergenativecodeanalysis-task-failed-unexpectedly\">https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/3113987\/error-msb4018-the-mergenativecodeanalysis-task-failed-unexpectedly<\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><strong>Send us your feedback!<\/strong><\/p>\n<p>We hope that the C++ Code Analysis tools in Visual Studio 2017 help improve your code and make you more productive. We\u2019d like to thank you all and as always, we welcome your feedback. Please tell us what you like and dislike about our current toolset and what you\u2019d like to see in future releases.<\/p>\n<p>For problems, let us know via the Report a Problem option, either from the installer or the Visual Studio IDE itself. And you can always reach us through e-mail at cppcorecheck@microsoft.com.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post was written by Sunny Chatterjee and Andrew Pardoe Visual Studio 2017 RTM \u00a0release includes the C++ Core Guidelines Checkers as part of Code Analysis tools for C\/C++. We have gotten a ton of useful feedback on the early previews of these checks through our external customers. Thank you for engaging with us [&hellip;]<\/p>\n","protected":false},"author":324,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270],"tags":[245,163],"class_list":["post-12645","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","tag-cppcorecheck","tag-static-analysis"],"acf":[],"blog_post_summary":"<p>This blog post was written by Sunny Chatterjee and Andrew Pardoe Visual Studio 2017 RTM \u00a0release includes the C++ Core Guidelines Checkers as part of Code Analysis tools for C\/C++. We have gotten a ton of useful feedback on the early previews of these checks through our external customers. Thank you for engaging with us [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/12645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/324"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=12645"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/12645\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=12645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=12645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=12645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}