Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Polyspace Bug Finder

Coding Standards Report for Project: polyspace


Report Author: ctreille
Polyspace Bug Finder: Coding Standards Report for Project: polyspace
by Report Author: ctreille

Published 15-Jun-2020 09:42:48


Analysis Author(s): Polyspace
Polyspace Version(s): Polyspace Bug Finder Server 3.3 (R2020b)
Project Version(s): 1.0

Result Folder(s):
C:\qualkits_R2020b\do\bugfinder\tests\bug-finder-server-results\reporting\template-codingstandards\OR-414-4-codingstandards_1
Table of Contents
Chapter 1. Custom Coding Rules ................................................................................................................................................................................................................ 1
Custom Coding Rules Summary - Violations by File ........................................................................................................................................................................ 1
Custom Coding Rules Summary - Violations by Rule ...................................................................................................................................................................... 1
Custom Coding Rules Summary for all Files ..................................................................................................................................................................................... 2
Custom Coding Rules Summary for Enabled Rules ......................................................................................................................................................................... 2
Custom Coding Rules Violations ........................................................................................................................................................................................................ 3
Chapter 2. Appendix 1 - Configuration Settings ....................................................................................................................................................................................... 6
Polyspace Settings ............................................................................................................................................................................................................................... 6
Coding Standard Configuration ......................................................................................................................................................................................................... 7
Chapter 3. Appendix 2 - Definitions ............................................................................................................................................................................................................ 9
................................................................................................................................................................................................................................................................. 9

i
Chapter 1. Custom Coding Rules
Custom Coding Rules Summary - Violations by File

Custom Coding Rules Summary - Violations by Rule

1
Custom Coding Rules Summary for all Files
File Total
C:\qualkits_R2020b\do\bugfinder\tests\reporting\template-codingstandards\OR-414-4-codingstandards_1.c 18
Total 18

Custom Coding Rules Summary for Enabled Rules


Rule Description Pattern Total
1.1 All source file names must follow the specified pattern. Geck_C.*.c 1
1.2 All source folder names must follow the specified pattern. .*sources 1
2.1 All macros must follow the specified pattern. MACRO_[A-Z0-9_]* 1
2.2 All macro parameters must follow the specified pattern. _mp_.* 1
3.1 All integer types must follow the specified pattern. .*_s 0
3.2 All float types must follow the specified pattern. .*_f 0
3.3 All pointer types must follow the specified pattern. .*_p 0
3.4 All array types must follow the specified pattern. .*_a 0
3.5 All function pointer types must follow the specified pattern. .*_fp 0
4.1 All struct tags must follow the specified pattern. _s_.* 1
4.2 All struct type must follow the specified pattern. s_.* 0
4.3 All struct fields must follow the specified pattern. f_.* 0
4.4 All struct bit fields must follow the specified pattern. bf_.* 0
5.1 All class names must follow the specified pattern. c_.* 0
5.2 All class types must follow the specified pattern. c_.*_t 0
5.3 All data members must follow the specified pattern. m_.* 0
5.4 All function members must follow the specified pattern. fm_.* 0
5.5 All static data members must follow the specified pattern. sm_.* 0
5.6 All static function members must follow the specified pattern. sf_.* 0
5.7 All bitfield members must follow the specified pattern. bm_.* 0
Total 18

2
Rule Description Pattern Total
6.1 All enumeration tags must follow the specified pattern. _e_.* 0
6.2 All enumeration types must follow the specified pattern. e_.* 0
6.3 All enumeration constants must follow the specified pattern. E_[A-Z_]+ 0
7.1 All global functions must follow the specified pattern. gf_.* 4
7.2 All static functions must follow the specified pattern. sf_.* 0
7.3 All function parameters must follow the specified pattern. .*_p 2
8.1 All global constants must follow the specified pattern. G_[A-Z][A-Z0-9_]* 0
8.2 All static constants must follow the specified pattern. S_[A-Z][A-Z0-9_]* 0
8.3 All local constants must follow the specified pattern. L_[A-Z][A-Z0-9_]* 0
8.4 All static local constants must follow the specified pattern. SL_[A-Z][A-Z0-9_]* 0
9.1 All global variables must follow the specified pattern. gv_[a-z][a-z0-9_]* 0
9.2 All static variables must follow the specified pattern. sv_[a-z][a-z0-9_]* 0
9.3 All local variables must follow the specified pattern. lv_[a-z][a-z0-9_]* 7
9.4 All static local variables must follow the specified pattern. slv_[a-z][a-z0-9_]* 0
10.1 All namespaces must follow the specified pattern. nm_.* 0
11.1 All class templates must follow the specified pattern. Tmp_.* 0
11.2 All class template parameters must follow the specified pattern. T_.* 0
12.1 All function templates must follow the specified pattern. F_.* 0
12.2 All function template parameters must follow the specified pattern. FT_.* 0
12.3 All function template members must follow the specified pattern. FM_.* 0
Total 18

Custom Coding Rules Violations


Table 1.1. C:\qualkits_R2020b\do\bugfinder\tests\reporting\template-codingstandards\OR-414-4-codingstandards_1.c
ID Rule Message Function Severity Status Comment
1 1.2 All source folder names must follow the specified pattern. File Scope Unset Unreviewed
files dirname
The source dir name 'C:\qualkits_R2020b\do\bugfinder\tests\reporting\te
mplate-codingstandards' does not match the specified pattern.

3
ID Rule Message Function Severity Status Comment
2 1.1 All source file names must follow the specified pattern. File Scope Unset Unreviewed
files basename
The source file name 'OR-414-4-codingstandards_1.c' does not match the
specified pattern.
3 2.1 All macros must follow the specified pattern. File Scope Unset Unreviewed
macros
The macro 'offsetof' does not match the specified pattern.
4 2.2 All macro parameters must follow the specified pattern. File Scope Unset Unreviewed
macro parameters
The macro parameter 'type' does not match the specified pattern.
macro parameters
The macro parameter 'field' does not match the specified pattern.
15 7.1 All global functions must follow the specified pattern. File Scope Unset Unreviewed
global functions
The global function 'foo1' does not match the specified pattern.
17 4.1 All struct tags must follow the specified pattern. foo1() Unset Unreviewed
struct tag names
The struct tag 'new_stc_2' does not match the specified pattern.
8 9.3 All local variables must follow the specified pattern. foo1() Unset Unreviewed
local variables
The local variable 'ptr_str_1' does not match the specified pattern.
7 9.3 All local variables must follow the specified pattern. foo1() Unset Unreviewed
local variables
The local variable 'ptr_union_2_2_1' does not match the specified patter
n.
5 7.1 All global functions must follow the specified pattern. File Scope Unset Unreviewed
global functions
The global function 'foo' does not match the specified pattern.
12 7.1 All global functions must follow the specified pattern. File Scope Unset Unreviewed
global functions
The global function 'bar' does not match the specified pattern.
10 9.3 All local variables must follow the specified pattern. bar() Unset Unreviewed
local variables
The local variable 'rd' does not match the specified pattern.
6 7.1 All global functions must follow the specified pattern. File Scope Unset Unreviewed
global functions
The global function 'func' does not match the specified pattern.
9 7.3 All function parameters must follow the specified pattern. main() Unset Unreviewed
function parameters
The function parameter 'argc' does not match the specified pattern.

4
ID Rule Message Function Severity Status Comment
13 7.3 All function parameters must follow the specified pattern. main() Unset Unreviewed
function parameters
The function parameter 'argv' does not match the specified pattern.
11 9.3 All local variables must follow the specified pattern. main() Unset Unreviewed
local variables
The local variable 'a' does not match the specified pattern.
14 9.3 All local variables must follow the specified pattern. main() Unset Unreviewed
local variables
The local variable 'b' does not match the specified pattern.
16 9.3 All local variables must follow the specified pattern. main() Unset Unreviewed
local variables
The local variable 'ptr' does not match the specified pattern.
18 9.3 All local variables must follow the specified pattern. main() Unset Unreviewed
local variables
The local variable 'p' does not match the specified pattern.

5
Chapter 2. Appendix 1 - Configuration Settings
Polyspace Settings
Option Value
-author Polyspace
-bug-finder true
-compiler generic
-custom-rules C:\qualkits_R2020b\do\bugfinder\tests\reporting\custom_rules.txt
-date 15/06/2020
-I C:\qualkits_R2020b\do\bugfinder\tests\options-api\lib
-lang C
-prog polyspace
-results-dir C:\qualkits_R2020b\do\bugfinder\tests\bug-finder-server-results\reporting\template-codingstandards\OR-414-4-codingstandards_1
-target i386
-verif-version 1.0
-checkers ALIGNMENT_CHANGE, ASSERT, ATOMIC_VAR_ACCESS_TWICE, ATOMIC_VAR_SEQUENCE_NOT_ATOMIC, BAD_EQUAL_EQUAL_USE, BAD_EQUAL_USE,
BAD_FREE, BAD_LOCK, BAD_PTR_SCALING, BAD_UNLOCK, CHARACTER_MISUSE, CHAR_EOF_CONFUSED, CLOSED_RESOURCE_USE, CONSTANT_OBJE
CT_WRITE, DATA_RACE, DATA_RACE_BIT_FIELDS, DATA_RACE_STD_LIB, DEADLOCK, DEAD_CODE, DECL_MISMATCH, DOUBLE_DEALLOCATION, DO
UBLE_LOCK, DOUBLE_RESOURCE_CLOSE, DOUBLE_RESOURCE_OPEN, DOUBLE_UNLOCK, ERRNO_MISUSE, FILE_OBJECT_MISUSE, FLEXIBLE_ARRAY_
MEMBER_STRUCT_MISUSE, FLOAT_ABSORPTION, FLOAT_CONV_OVFL, FLOAT_STD_LIB, FLOAT_ZERO_DIV, FREED_PTR, FUNC_CAST, IMPROPER_ARR
AY_INIT, INLINE_CONSTRAINT_NOT_RESPECTED, INT_CONV_OVFL, INT_STD_LIB, INT_ZERO_DIV, INVALID_ENV_POINTER, INVALID_MEMORY_ASSU
MPTION, INVALID_VA_LIST_ARG, IO_INTERLEAVING, LOCAL_ADDR_ESCAPE, MACRO_USED_AS_OBJECT, MEMCMP_PADDING_DATA, MEMCMP_STRI
NGS, MEM_STD_LIB, MISSING_ERRNO_RESET, MISSING_NULL_CHAR, MISSING_RETURN, NON_INIT_PTR, NON_INIT_VAR, NON_POSITIVE_VLA_SIZE,
NULL_PTR, OPERATOR_PRECEDENCE, OTHER_STD_LIB, OUT_BOUND_ARRAY, OUT_BOUND_PTR, PARTIALLY_ACCESSED_ARRAY, PRE_DIRECTIVE_MA
CRO_ARG, PRE_UCNAME_JOIN_TOKENS, PTR_CAST, PTR_SIZEOF_MISMATCH, PTR_TO_DIFF_ARRAY, PUTENV_AUTO_VAR, READ_ONLY_RESOURCE_W
RITE, RESOURCE_LEAK, SIDE_EFFECT_IGNORED, SIGN_CHANGE, SIG_HANDLER_CALLING_SIGNAL, SIG_HANDLER_COMP_EXCP_RETURN, SIG_HAND
LER_ERRNO_MISUSE, SIG_HANDLER_SHARED_OBJECT, SIZEOF_MISUSE, STD_FUNC_ARG_MISMATCH, STREAM_WITH_SIDE_EFFECT, STRING_FORMA
T, STRLIB_BUFFER_OVERFLOW, STRLIB_BUFFER_UNDERFLOW, STR_FORMAT_BUFFER_OVERFLOW, STR_STD_LIB, TEMP_OBJECT_ACCESS, TOO_MA
NY_VA_ARG_CALLS, TYPEDEF_MISMATCH, UINT_CONV_OVFL, UNPROTOTYPED_FUNC_CALL, UNREACHABLE, USELESS_IF, USELESS_WRITE, VAR_SH
ADOWING, VA_ARG_INCORRECT_TYPE, VA_START_INCORRECT_TYPE, VA_START_MISUSE

6
Coding Standard Configuration
Table 2.1. Custom Coding Rules Configuration
Rule Description Convention Pattern Comment Enabled
1.1 All source file names must follow the specified pattern. files basename Geck_C.*.c - yes
1.2 All source folder names must follow the specified pattern. files dirname .*sources - yes
1.3 All include file names must follow the specified pattern. - - - no
1.4 All include folder names must follow the specified pattern. - - - no
2.1 All macros must follow the specified pattern. macros MACRO_[A-Z0-9_]* - yes
2.2 All macro parameters must follow the specified pattern. macro parameters _mp_.* - yes
3.1 All integer types must follow the specified pattern. integer type names .*_s - yes
3.2 All float types must follow the specified pattern. float type names .*_f - yes
3.3 All pointer types must follow the specified pattern. pointer type names .*_p - yes
3.4 All array types must follow the specified pattern. array type names .*_a - yes
3.5 All function pointer types must follow the specified pattern. function pointer type nam .*_fp - yes
es
4.1 All struct tags must follow the specified pattern. struct tag names _s_.* - yes
4.2 All struct type must follow the specified pattern. struct type names s_.* - yes
4.3 All struct fields must follow the specified pattern. struct fields f_.* - yes
4.4 All struct bit fields must follow the specified pattern. struct bit fields bf_.* - yes
5.1 All class names must follow the specified pattern. class names c_.* C++ yes
5.2 All class types must follow the specified pattern. class type names c_.*_t C++ yes
5.3 All data members must follow the specified pattern. data members m_.* C++ yes
5.4 All function members must follow the specified pattern. function members fm_.* C++ yes
5.5 All static data members must follow the specified pattern. static data members sm_.* C++ yes
5.6 All static function members must follow the specified pattern. static function members sf_.* C++ yes
5.7 All bitfield members must follow the specified pattern. bitfield members bm_.* C++ yes
6.1 All enumeration tags must follow the specified pattern. enumeration tag names _e_.* - yes
6.2 All enumeration types must follow the specified pattern. enumeration type names e_.* - yes
6.3 All enumeration constants must follow the specified pattern. enumeration constants E_[A-Z_]+ - yes

7
Rule Description Convention Pattern Comment Enabled
7.1 All global functions must follow the specified pattern. global functions gf_.* - yes
7.2 All static functions must follow the specified pattern. static functions sf_.* - yes
7.3 All function parameters must follow the specified pattern. function parameters .*_p - yes
8.1 All global constants must follow the specified pattern. global constants G_[A-Z][A-Z0-9_]* - yes
8.2 All static constants must follow the specified pattern. static constants S_[A-Z][A-Z0-9_]* - yes
8.3 All local constants must follow the specified pattern. local constants L_[A-Z][A-Z0-9_]* - yes
8.4 All static local constants must follow the specified pattern. static local constants SL_[A-Z][A-Z0-9_]* - yes
9.1 All global variables must follow the specified pattern. global variables gv_[a-z][a-z0-9_]* - yes
9.2 All static variables must follow the specified pattern. static variables sv_[a-z][a-z0-9_]* - yes
9.3 All local variables must follow the specified pattern. local variables lv_[a-z][a-z0-9_]* - yes
9.4 All static local variables must follow the specified pattern. static local variables slv_[a-z][a-z0-9_]* - yes
10.1 All namespaces must follow the specified pattern. namespaces nm_.* C++ yes
11.1 All class templates must follow the specified pattern. class templates Tmp_.* C++ yes
11.2 All class template parameters must follow the specified pattern. class template parameters T_.* C++ yes
12.1 All function templates must follow the specified pattern. function templates F_.* C++ yes
12.2 All function template parameters must follow the specified pattern. function template parame FT_.* C++ yes
ters
12.3 All function template members must follow the specified pattern. function template membe FM_.* C++ yes
rs
20.1 Source line length must not exceed specified number of characters. - - - no

8
Chapter 3. Appendix 2 - Definitions

Table 3.1. Abbreviations


Abbreviation Definition
NA Not Available

You might also like