Navigation
Search
|
Microsoft C++ static analysis tool bolsters warning suppressions
Tuesday July 22, 2025. 11:30 PM , from InfoWorld
The Microsoft C++ Code Analysis tool has been updated to provide better tracking, justification, and overall management of warning suppressions. These improvements lead to a more maintainable and robust code base, according to Microsoft.
Improvements to Microsoft C++ Code Analysis were detailed in a July 15 blog post. Enhancements to warning suppression offer improved auditability and review, enhanced code maintainability, better management of technical debt, and consistency across suppression mechanisms, Microsoft said. With the updates to the static analysis tool, which is integrated into the Visual Studio 2022 17.14 IDE, support for gsl::suppress has been updated to align with the latest C++ Core Guidelines syntax. Warnings now can be suppressed by using the gsl::suppress attribute. In addition, the #pragma warning has been extended to support the justification field. Both #pragma warning(suppress) and [[gsl::suppress]] offer fine-grained control over warning suppression, with #pragma warning(suppress) being a general MSVC (Microsoft Visual C++) compiler mechanism that can be used for any compiler warning, while [[gsl::suppress]] will only suppress warnings emitted by Microsoft C++ Code Analysis. Microsoft recommends using [[gsl::suppress]] for suppressing Microsoft C++ Code Analysis warnings whenever possible. Finally, Microsoft C++ Code Analysis now offers enhanced Static Analysis Results Interchange Format (SARIF) output to include detailed information about warning suppressions, most notably the justification for the suppression provided by the developer. This lets teams review why a specific warning was silenced. The suppression mechanism enhancements in Microsoft C++ Code Analysis are available in the MSVC compiler tool set shipping with Visual Studio 2022 version 17.14. Newer Visual Studio versions also will have these enhancements.
https://www.infoworld.com/article/4026746/microsoft-c-static-analysis-tool-bolsters-warning-suppress...
Related News |
25 sources
Current Date
Jul, Wed 23 - 11:15 CEST
|