Keywords: qac source
qac_compiler is a wrapper for QAC static analysis tool. It as the same interface as the gnu compiler collection (gcc). The compiler wrapper will compile the source code using the parameters specified at command line. It will also invoke QAC to analyze the source code. This results in annotated source code files with extension .qac. The annotated source file contain warnings that QAC has issued.
There are two warning subsets that can be applied by qac_compiler. These language subsets represent the two different programming standard (i.e. the ABSOLUTE programming standard and the RELATIVE programming standard.
Absolute programming standard The absolute programming standards is a warning subset which excludes erroneous constructions in the C programming language. QAC warnings resulting from this warning subset must always be solved as they represent real errors. The absolute programming standards applied to ALL code.
Relative programming standard The relative programming standards is a warning subset which excludes erroneous as well as dangerous constructions in the C programming language. QAC warnings resulting from this warning subset must always be solved as they represent problems with respect to run-time behavior or maintenance aspects. The relative programming standards is more strict than the absolute standard and must be applied to NEWLY developed code of WDS. By default the absolute programming standard is employed by qac_compiler.
The behavior of the qac_compiler script can be influenced by comment lines in the code. By adding /* QAC APPLY RELATIVE */ in the source code, the relative programming standard will be in effect will analyzing that specific compilation unit (i.e. source code file). This is demonstrated below:
It does not matter where the ``QAC APPLY RELATIVE'' tag is located as long it is somewhere in the code.
It is important that warnings which can be ignored according to the author of the code are suppressed. This can be achieved by adding a comment with a suppression tag. A suppression tag is a specific comment which is placed above the line resulting in the qac warning. This is demonstrated by the next example: