From 3e310daed1033c9a75d9c83acc5f668576ea6759 Mon Sep 17 00:00:00 2001 From: Sergey Larin Date: Fri, 19 Jun 2020 14:17:21 +0300 Subject: [PATCH] Add pvs-studio config files --- pvs_studio/pvs-studio.pvsconfig | 37 +++++++++++++++++++++++++++++++++ pvs_studio/pvs_config.h | 35 +++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100755 pvs_studio/pvs-studio.pvsconfig create mode 100755 pvs_studio/pvs_config.h diff --git a/pvs_studio/pvs-studio.pvsconfig b/pvs_studio/pvs-studio.pvsconfig new file mode 100755 index 0000000..2a103a6 --- /dev/null +++ b/pvs_studio/pvs-studio.pvsconfig @@ -0,0 +1,37 @@ +# This is the configuration file for the PVS-Studio plugin for Visual Studio: +# https://www.viva64.com/en/pvs-studio/ +# +# This file can be used to suppress false positives in macros, annotate specific functions, +# and so on. See the following documentation sections for details: +# * Suppression of false alarms - https://www.viva64.com/en/m/0017/ +# * Additional diagnostics configuration - https://www.viva64.com/en/m/0040/ +# +# For instance, you can use this file to specify an alias for a system function. +# Sometimes projects use custom implementations of certain system functions such as memcpy, +# malloc, and so on. In this case, the analyzer will not be able to recognize their +# behavior as that of their standard counterparts. Using the V_FUNC_ALIAS annotation, +# you can specify which custom functions correspond to which system ones. Comment format: +# //V_FUNC_ALIAS, implementation:sysf, function:f, namespace:ns, class:c +# +# For example: +# //V_FUNC_ALIAS, implementation:memcpy, function:MyMemCpy +# +# Now the analyzer will process calls to the MyMemCpy function in the same way it processes +# calls to memcpy. For example, the following code will trigger the V512 warning: +# int buf[] = { 1, 2, 3, 4 }; +# int out[2]; +# MyMemCpy (out, buf, 4 * sizeof(int)); // Warning! +# +# You can also use this file to suppress warnings on lines that contain a specific +# character sequence. This option is typically useful for mass suppression of warnings +# triggered by a certain macro. +# //-V:TEST_MACRO:1001, 105, 201 +# This comment turns off the warnings V105, V201, and V1001 for the line where the macro +# TEST_MACRO is used. +# +# The # character is considered a comment-introducing character in .pvsconfig files. +# +# As already mentioned, all these and other settings are described in detail in the +# documentation sections the links to which are given at the beginning of this document. + +//-V:SUPPRESS_EXAMPLE_MY_MACROS:501 diff --git a/pvs_studio/pvs_config.h b/pvs_studio/pvs_config.h new file mode 100755 index 0000000..c287594 --- /dev/null +++ b/pvs_studio/pvs_config.h @@ -0,0 +1,35 @@ +// This is the configuration file for the PVS-Studio static analyzer. +// https://www.viva64.com/en/pvs-studio/ +// +// This file can be used to suppress false positives in macros, annotate specific functions, +// and so on. See the following documentation sections for details: +// * Suppression of false alarms - https://www.viva64.com/en/m/0017/ +// * Additional diagnostics configuration - https://www.viva64.com/en/m/0040/ +// +// For instance, you can use this file to specify an alias for a system function. +// Sometimes projects use custom implementations of certain system functions such as memcpy, +// malloc, and so on. In this case, the analyzer will not be able to recognize their +// behavior as that of their standard counterparts. Using the V_FUNC_ALIAS annotation, +// you can specify which custom functions correspond to which system ones. Comment format: +// //V_FUNC_ALIAS, implementation:sysf, function:f, namespace:ns, class:c +// +// For example: +// //V_FUNC_ALIAS, implementation:memcpy, function:MyMemCpy +// +// Now the analyzer will process calls to the MyMemCpy function in the same way it processes +// calls to memcpy. For example, the following code will trigger the V512 warning: +// int buf[] = { 1, 2, 3, 4 }; +// int out[2]; +// MyMemCpy (out, buf, 4 * sizeof(int)); // Warning! +// +// You can also use this file to suppress warnings on lines that contain a specific +// character sequence. This option is typically useful for mass suppression of warnings +// triggered by a certain macro. +// //-V:TEST_MACRO:1001, 105, 201 +// This comment turns off the warnings V105, V201, and V1001 for the line where the macro +// TEST_MACRO is used. +// +// As already mentioned, all these and other settings are described in detail in the +// documentation sections the links to which are given at the beginning of this document. + +//-V:SUPPRESS_EXAMPLE_MY_MACROS:501