{"id":398606,"date":"2024-06-29T14:10:24","date_gmt":"2024-06-29T14:10:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=398606"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=398606","title":{"rendered":"<span>PVS-Studio 7.16, expanding the horizons: MISRA C, Visual Studio 2022, .NET 6<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>This is the latest release of PVS-Studio in 2021. With it, the PVS-Studio team accomplishes several important goals. Now, PVS-Studio supports Visual Studio 2022, the .NET 6 platform and C# 10.0. We implemented all diagnostics categorized as Mandatory in MISRA C.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ih\/r-\/hk\/ihr-hkzde4u_h5loe-d6gno-mfi.png\" alt=\"PVS-Studio Release 7.16\" data-src=\"https:\/\/habrastorage.org\/webt\/ih\/r-\/hk\/ihr-hkzde4u_h5loe-d6gno-mfi.png\"\/><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"the-visual-studio-2022-support\">The Visual Studio 2022 support<\/h2>\n<p>  <\/p>\n<p>Now, PVS-Studio supports Visual Studio 2022. You can use the analyzer to check C++ and C# projects. PVS-Studio supports projects built with new versions of C++ and .NET standard libraries.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/037\/314\/bec\/037314bec2bc725febf0f0d6420f926f.png\" alt=\"PVS-Studio supports Visual Studio 2022\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/037\/314\/bec\/037314bec2bc725febf0f0d6420f926f.png\"\/><\/p>\n<p>  <\/p>\n<p>From the user&#8217;s point of view, the analyzer interface, and the way the tool works have not changed a lot. We have to update our &#171;<a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/0635\/\">PVS-Studio for Visual Studio<\/a>&#187; article of 2019, but in general, the information in the article is relevant.<\/p>\n<p>  <\/p>\n<h2 id=\"net-6-and-c-100-support\">.NET 6 and C# 10.0 support<\/h2>\n<p>  <\/p>\n<p>Now, the PVS-Studio C# analyzer supports the .NET 6 platform for Windows, Linux, and macOS. We also added the support of C# 10.0. Besides, the C# analyzer for Linux and macOS now works for .NET 6.<\/p>\n<p>  <\/p>\n<p>Taking the opportunity, we invite you to read the following article: &#171;<a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/0875\/\">What&#8217;s new in C# 10: overview<\/a>&#171;.<\/p>\n<p>  <\/p>\n<h2 id=\"misra-c\">MISRA C<\/h2>\n<p>  <\/p>\n<p>PVS-Studio supports 80% of the MISRA C standard for safety and security. The tool fully covers the warnings categorized as Mandatory and most of the warnings from the Required category.<\/p>\n<p>  <\/p>\n<p>See also:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/0702\/\">What is MISRA and how to cook it<\/a>;<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/0863\/\">Why do you need the MISRA Compliance report and how to generate one in PVS-Studio?<\/a><\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/pvs-studio\/sast\/misra\/\">Classification of PVS-Studio warnings according to the standards: MISRA C, MISRA C++<\/a>.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"different-enhancements\">Different enhancements<\/h2>\n<p>  <\/p>\n<p>The mechanism to suppress warnings for existing code (<a href=\"https:\/\/pvs-studio.com\/en\/docs\/manual\/0032\/\">baseline, suppression of warnings<\/a>) now can work with Unreal Engine projects. In this release, the baseline mechanism is available only for UE projects in the command-line version of the PVS-Studio analyzer. The next version of PVS-Studio will support the suppression of warnings for UE projects directly from Visual Studio and JetBrains Rider.<\/p>\n<p>  <\/p>\n<p><strong>Note.<\/strong> To learn more about the disabling of warnings for existing code, read the following article: &#171;<a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/0743\/\">How to introduce a static code analyzer in a legacy project and not to discourage the team<\/a>&#171;.<\/p>\n<p>  <\/p>\n<p>Also, we have a new documentation section explaining how to use PVS-Studio to check projects whose build model is represented in the <a href=\"https:\/\/pvs-studio.com\/en\/docs\/manual\/6557\/\">JSON Compilation Database<\/a> format. This method is available for projects based on CMake, QBS, Ninja, etc.<\/p>\n<p>  <\/p>\n<p>Now, in the PVS-Studio plugins for <a href=\"https:\/\/pvs-studio.com\/en\/docs\/manual\/0044\/\">JetBrains IDEA<\/a>, <a href=\"https:\/\/pvs-studio.com\/en\/docs\/manual\/0052\/\">Rider and CLion<\/a>, you can customize shortcuts for the most frequently used actions for checking projects and working with analysis results.<\/p>\n<p>  <\/p>\n<h2 id=\"new-diagnostics\">New diagnostics<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v833\/\">V833<\/a>. Using &#8216;std::move&#8217; function with const object disables move semantics.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v1076\/\">V1076<\/a>. Code contains invisible characters that may alter its logic. Consider enabling the display of invisible characters in the code editor.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v2615\/\">V2615<\/a>. MISRA. A compatible declaration should be visible when an object or function with external linkage is defined.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v2616\/\">V2616<\/a>. MISRA. All conditional inclusion preprocessor directives should reside in the same file as the conditional inclusion directive to which they are related.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v2617\/\">V2617<\/a>. MISRA. Object should not be assigned or copied to an overlapping object.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v2618\/\">V2618<\/a>. MISRA. Identifiers declared in the same scope and name space should be distinct.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v2619\/\">V2619<\/a>. MISRA. Typedef names should be unique across all name spaces.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v2620\/\">V2620<\/a>. MISRA. Value of a composite expression should not be cast to a different essential type category or a wider essential type.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v2621\/\">V2621<\/a>. MISRA. Tag names should be unique across all name spaces.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v2622\/\">V2622<\/a>. MISRA. External object or function should be declared once in one and only one file.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/w\/v5616\/\">V5616<\/a>. OWASP. Possible command injection. Potentially tainted data is used to create OS command.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"latest-articles-in-our-blog\">Latest articles in our blog<\/h2>\n<p>  <\/p>\n<ol>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/0873\/\">C++ tools evolution: static code analyzers<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/0880\/\">How a PVS-Studio developer defended a bug in a checked project<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/0885\/\">All hail bug reports: how we reduced the analysis time of the user&#8217;s project from 80 to 4 hours<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/0888\/\">How the Carla car simulator helped us level up the static analysis of Unreal Engine 4 projects<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/0890\/\">A variety of errors in C# code by the example of CMS DotNetNuke: 40 questions about the quality<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/0889\/\">Thanks, Mario, but the code needs fixing \u2014 checking TheXTech<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/0876\/\">OWASP Top Ten and Software Composition Analysis (SCA)<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/0891\/\">Virtual function calls in constructors and destructors (C++)<\/a>.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2 id=\"feedback\">Feedback<\/h2>\n<p>  <\/p>\n<p>Thank you for your attention and interest in our product. If you have any questions or suggestions, we are always ready to <a href=\"https:\/\/pvs-studio.com\/en\/about-feedback\/\">discuss them<\/a>. We&#8217;d also appreciate if you give us feedback on the new features of the analyzer.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/594613\/\"> https:\/\/habr.com\/ru\/articles\/594613\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>This is the latest release of PVS-Studio in 2021. With it, the PVS-Studio team accomplishes several important goals. Now, PVS-Studio supports Visual Studio 2022, the .NET 6 platform and C# 10.0. We implemented all diagnostics categorized as Mandatory in MISRA C.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ih\/r-\/hk\/ihr-hkzde4u_h5loe-d6gno-mfi.png\" alt=\"PVS-Studio Release 7.16\" data-src=\"https:\/\/habrastorage.org\/webt\/ih\/r-\/hk\/ihr-hkzde4u_h5loe-d6gno-mfi.png\"\/><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-398606","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=398606"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398606\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}