It is possible to use the Visual Studio compiler as a code checker (static analyzer) for C, C++ and C#. This means that the compiler warning level is set to maximum and any compiler warnings are stored in the quality database as violations. This makes it possible to track and reduce compiler warnings over time in a controlled manner.
A default configuration for compiler warnings is provided by TICS in
the configuration directory (in
C/C++, the analyzer
VC is used, for C#,
By default, all warnings are reported (the maximum Visual Studio warning level is used).
To configure warnings, one must specify the rule ID both in
RULES.txt (just as for coding
C++4057 VC C4057 C4057 VC C4057 C++4746 VC C4746 C4746 VC C4746
Here, the first three colums are relevant. The fourth column is not (yet)
used. (For the moment, it is recommended to repeat the rule ID here.) The
first three columns specify the rule ID (Visual Studio warning code), the
language for which it should override the defaults and the analyzer tool
C++4127 5 Visual Studio Severe Compiler Warning A conditional expression should not be constant. C4127 5 Visual Studio Severe Compiler Warning A conditional expression should not be constant. C++4706 7 Visual Studio Compiler Warning Avoid side-effects in conditional expressions. C4706 7 Visual Studio Compiler Warning Avoid side-effects in conditional expressions.
Here, all aspects of the warning can be modified except for its ID (i.e., level, category and synopsis).
As mentioned previously, by default, all warnings are enabled (the
maximum Visual Studio warning level is used). It is not possible to
disable warnings via the
IMPL.txt since all warnings are
To disable unwanted warnings, one must use the Visual Studio pragmas for controlling warnings.
or#pragma warning(disable: 4057 4746)
to disable warnings#pragma warning(disable: 4057) #pragma warning(disable: 4746)
Note the absence of the 'C' prefix in the #pragma!
It is possible to globally disable warnings by placing such pragmas in the
See the MSDN C/C++ Building Reference for a list of all compiler warnings.
TICS_NET_ASSEMBLY_PATH. The syntax is similar to other search path variables: a list of directories separated by semicolons ('
set TICS_NET_ASSEMBLY_PATH=C:\app\tiobe\product\11.2.0\client_2\odp.net\bin\2.x;C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies;C:\Program Files (x86)\SunGard\AvantGard\4.4\Browser\Quantum;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86