3454 lines
211 KiB
Plaintext
3454 lines
211 KiB
Plaintext
|
|
|||
|
********************************************************************
|
|||
|
****** ******
|
|||
|
****** LDRA Testbed (R) Code Review Report ******
|
|||
|
****** ******
|
|||
|
****** File : /home/student/anw0044/CPE455/lab08/mode-s.c ******
|
|||
|
****** ******
|
|||
|
********************************************************************
|
|||
|
|
|||
|
|
|||
|
|
|||
|
----------------------------------------------------------------------------------------------------
|
|||
|
***************************
|
|||
|
* *
|
|||
|
* Overall Result: FAIL *
|
|||
|
* *
|
|||
|
***************************
|
|||
|
----------------------------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
Report Production
|
|||
|
-----------------
|
|||
|
* C/C++ LDRA Testbed Version: 9.8.2 * Config. File: /apps/ldra2019/ldra_toolsuite/c/creport.dat
|
|||
|
* Produced On: Tue Mar 29 2022 at 10:19:09 * Penalty File: /apps/ldra2019/ldra_toolsuite/c/cpen.dat
|
|||
|
|
|||
|
|
|||
|
Report Configuration
|
|||
|
--------------------
|
|||
|
* Report Level: Detailed Report * Procedures Reported: Fails Only
|
|||
|
* Programming Standards Model: MISRA-C:2012(Ed 3 Rev 1)
|
|||
|
* Line Numbers refer to: Original Source File
|
|||
|
* Violation Details: Violations and Associated Source
|
|||
|
* Reporting Scope: Source file and associated header
|
|||
|
|
|||
|
|
|||
|
Analysis Phases Run
|
|||
|
-------------------
|
|||
|
* Static: Yes * Complexity: Yes
|
|||
|
* Static Data Flow: Yes * Information Flow: No
|
|||
|
* Cross Reference: Yes
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
Contents
|
|||
|
--------
|
|||
|
Overall Code Review Summary
|
|||
|
* Totals of Violations for each Standard
|
|||
|
* Table of Procedure Results
|
|||
|
* Table of Global Basic Information
|
|||
|
|
|||
|
Report on Program Components
|
|||
|
* Code Review Results Global Program and Selected Procedures
|
|||
|
|
|||
|
Key to Terms
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
*********************************
|
|||
|
* *
|
|||
|
* Overall Code Review Summary *
|
|||
|
* *
|
|||
|
*********************************
|
|||
|
|
|||
|
|
|||
|
Totals of Violations for Selected Code Review Standards
|
|||
|
-------------------------------------------------------
|
|||
|
'-' indicates required Analysis Phase results are not yet available.
|
|||
|
'Off' indicates that the standard is switched off in the Penalty File (<lang>pen.dat).
|
|||
|
'*' indicates standard has been violated.
|
|||
|
|
|||
|
==============================================================================================================
|
|||
|
NUMBER OF
|
|||
|
VIOLATIONS LDRA CODE MANDATORY STANDARDS MISRA-C:2012(ED 3 REV 1) CODE
|
|||
|
==============================================================================================================
|
|||
|
0 36 S Function has no return statement. MISRA-C:2012(Ed 3 Rev 1) R.17.4
|
|||
|
0 54 S Sizeof operator with side effects. MISRA-C:2012(Ed 3 Rev 1) R.13.6
|
|||
|
0 66 S Function with empty return expression. MISRA-C:2012(Ed 3 Rev 1) R.17.4
|
|||
|
2 401 S * Use of sizeof on an array parameter. MISRA-C:2012(Ed 3 Rev 1) R.12.5
|
|||
|
0 407 S free used on string. MISRA-C:2012(Ed 3 Rev 1) R.22.2
|
|||
|
0 480 S String function params access same variable. MISRA-C:2012(Ed 3 Rev 1) R.19.1
|
|||
|
0 483 S Freed parameter is not heap item. MISRA-C:2012(Ed 3 Rev 1) R.22.2
|
|||
|
0 484 S Attempt to use already freed object. MISRA-C:2012(Ed 3 Rev 1) R.22.2
|
|||
|
0 489 S Insufficient space for operation. MISRA-C:2012(Ed 3 Rev 1) R.1.3,R.21.17,R.21.18
|
|||
|
1 496 S * Function call with no prior declaration. MISRA-C:2012(Ed 3 Rev 1) R.17.3
|
|||
|
0 545 S Assignment of overlapping storage. MISRA-C:2012(Ed 3 Rev 1) R.19.1
|
|||
|
0 591 S Inappropriate use of file pointer. MISRA-C:2012(Ed 3 Rev 1) R.22.5
|
|||
|
0 600 S Argument of strlen is unterminated. MISRA-C:2012(Ed 3 Rev 1) R.21.17
|
|||
|
0 614 S Use of static keyword in array parameter. MISRA-C:2012(Ed 3 Rev 1) R.17.6
|
|||
|
0 631 S Declaration not reachable. MISRA-C:2012(Ed 3 Rev 1) R.9.1
|
|||
|
0 644 S realloc ptr does not originate from allocation function.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.22.2
|
|||
|
0 647 S Overlapping data items in memcpy. MISRA-C:2012(Ed 3 Rev 1) R.19.1
|
|||
|
0 652 S Object created by malloc used before initialisation.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.9.1
|
|||
|
0 663 S Invalid value may be passed to function in <ctype.h>.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.21.13
|
|||
|
0 2 D Function does not return a value on all paths. MISRA-C:2012(Ed 3 Rev 1) R.17.4
|
|||
|
0 48 D Attempt to write to unopened file. MISRA-C:2012(Ed 3 Rev 1) R.22.6
|
|||
|
0 51 D Attempt to read from freed memory. MISRA-C:2012(Ed 3 Rev 1) R.22.2
|
|||
|
0 53 D Attempt to use uninitialised pointer. MISRA-C:2012(Ed 3 Rev 1) R.9.1
|
|||
|
3 69 D * Procedure contains UR data flow anomalies. MISRA-C:2012(Ed 3 Rev 1) R.9.1
|
|||
|
0 98 D Attempt to write to file opened read only. MISRA-C:2012(Ed 3 Rev 1) R.22.4
|
|||
|
0 107 D Attempt to change system call capture string. MISRA-C:2012(Ed 3 Rev 1) R.21.19
|
|||
|
0 113 D File closed more than once. MISRA-C:2012(Ed 3 Rev 1) R.22.6
|
|||
|
0 125 D free called on variable with no allocated space. MISRA-C:2012(Ed 3 Rev 1) R.22.2
|
|||
|
0 133 D Pointer from system function used after subsequent call.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.21.20
|
|||
|
7 140 D * Copy source parameter not checked before use. MISRA-C:2012(Ed 3 Rev 1) R.21.17
|
|||
|
0 66 X Insufficient array space at call. MISRA-C:2012(Ed 3 Rev 1) R.1.3,R.21.17,R.21.18
|
|||
|
0 70 X Array has insufficient space. MISRA-C:2012(Ed 3 Rev 1) R.1.3,R.21.17,R.21.18
|
|||
|
0 71 X Insufficient space for copy. MISRA-C:2012(Ed 3 Rev 1) R.1.3,R.21.17,R.21.18
|
|||
|
0 79 X Size mismatch in memcpy/memset. MISRA-C:2012(Ed 3 Rev 1) R.1.3,R.21.18
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
==============================================================================================================
|
|||
|
NUMBER OF
|
|||
|
VIOLATIONS LDRA CODE REQUIRED STANDARDS MISRA-C:2012(ED 3 REV 1) CODE
|
|||
|
==============================================================================================================
|
|||
|
0 1 S Procedure name reused. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
2 9 S * Assignment operation in expression. MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.2,R.13.4
|
|||
|
0 11 S No brackets to loop body. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
17 12 S * No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
0 20 S Parameter not declared explicitly. MISRA-C:2012(Ed 3 Rev 1) R.8.1
|
|||
|
0 21 S Number of parameters does not match. MISRA-C:2012(Ed 3 Rev 1) R.1.1,R.1.3
|
|||
|
0 30 S Deprecated usage of ++ or -- operators found. MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.2,R.13.3
|
|||
|
0 35 S Static procedure is not explicitly called in code analysed.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.2.1
|
|||
|
0 37 S Procedure parameter has a type but no identifier. MISRA-C:2012(Ed 3 Rev 1) R.8.2
|
|||
|
0 39 S Unsuitable type for loop variable. MISRA-C:2012(Ed 3 Rev 1) R.14.1
|
|||
|
0 43 S Use of setjmp/longjmp. MISRA-C:2012(Ed 3 Rev 1) R.21.4
|
|||
|
0 44 S Use of banned function, type or variable. MISRA-C:2012(Ed 3 Rev 1) D.4.12,R.1.3,R.17.1,R.21.3,R.21.6,R.21.7,R.21.8,R.21.9,R.21.10,R.21.12
|
|||
|
0 47 S Array bound exceeded. MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
0 48 S No default case in switch statement. MISRA-C:2012(Ed 3 Rev 1) R.16.4
|
|||
|
57 50 S * Use of shift operator on signed type. MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
1 51 S * Shifting value too far. MISRA-C:2012(Ed 3 Rev 1) R.12.2
|
|||
|
0 52 S Unsigned expression negated. MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
0 57 S Statement with no side effect. MISRA-C:2012(Ed 3 Rev 1) R.2.2
|
|||
|
3 59 S * Else alternative missing in if. MISRA-C:2012(Ed 3 Rev 1) R.15.7
|
|||
|
0 60 S Empty switch statement. MISRA-C:2012(Ed 3 Rev 1) R.16.6
|
|||
|
0 61 S Switch contains default only. MISRA-C:2012(Ed 3 Rev 1) R.16.6
|
|||
|
0 62 S Switch case not terminated with break. MISRA-C:2012(Ed 3 Rev 1) R.16.3
|
|||
|
0 63 S Empty parameter list to procedure/function. MISRA-C:2012(Ed 3 Rev 1) R.8.2
|
|||
|
0 64 S Void procedure used in expression. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 65 S Void variable passed as parameter. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 71 S Pointer assignment to wider scope. MISRA-C:2012(Ed 3 Rev 1) R.18.6
|
|||
|
0 72 S Signed bit field less than 2 bits wide. MISRA-C:2012(Ed 3 Rev 1) R.6.2
|
|||
|
0 73 S Bit field not signed or unsigned int. MISRA-C:2012(Ed 3 Rev 1) R.6.1
|
|||
|
0 78 S Macro parameter not in brackets. MISRA-C:2012(Ed 3 Rev 1) R.20.7
|
|||
|
0 83 S Octal number found. MISRA-C:2012(Ed 3 Rev 1) R.7.1
|
|||
|
0 86 S Attempt to define reserved word. MISRA-C:2012(Ed 3 Rev 1) R.20.4,R.21.1
|
|||
|
0 88 S Procedure is not pure assembler. MISRA-C:2012(Ed 3 Rev 1) D.4.3
|
|||
|
0 92 S Duplicate use of a name in an enumeration. MISRA-C:2012(Ed 3 Rev 1) R.5.3
|
|||
|
13 93 S * Value is not of appropriate type. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
0 94 S Casting operation on a pointer. MISRA-C:2012(Ed 3 Rev 1) R.11.1,R.11.2,R.11.3,R.11.7
|
|||
|
0 95 S Casting operation to a pointer. MISRA-C:2012(Ed 3 Rev 1) R.11.1,R.11.2,R.11.3,R.11.5,R.11.7
|
|||
|
11 96 S * Use of mixed mode arithmetic. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
0 100 S #include filename is non conformant. MISRA-C:2012(Ed 3 Rev 1) R.20.2
|
|||
|
0 101 S Function return type inconsistent. MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
0 102 S Function and prototype return inconsistent (MR). MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
0 103 S Function and prototype param inconsistent (MR). MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
0 104 S Struct field initialisation incorrect. MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
0 105 S Initialisation brace { } fault. MISRA-C:2012(Ed 3 Rev 1) R.9.2
|
|||
|
0 107 S Type mismatch in ternary expression. MISRA-C:2012(Ed 3 Rev 1) R.10.4
|
|||
|
0 109 S Array subscript is not integral. MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
0 112 S Typedef name redeclared. MISRA-C:2012(Ed 3 Rev 1) R.5.6
|
|||
|
0 113 S Non standard character in source. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
30 114 S * Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
0 118 S main must be int (void) or int (int,char*[]). MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 119 S Nested comment found. MISRA-C:2012(Ed 3 Rev 1) R.3.1
|
|||
|
135 120 S * Use of bit operator on signed type. MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
0 121 S Use of boolean expression in switch. MISRA-C:2012(Ed 3 Rev 1) R.16.7
|
|||
|
0 122 S Use of abort, exit, etc. MISRA-C:2012(Ed 3 Rev 1) R.21.8
|
|||
|
0 123 S Use of underlying enum representation value. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4
|
|||
|
0 125 S Use of ## or # in a macro. MISRA-C:2012(Ed 3 Rev 1) R.20.10,R.20.12
|
|||
|
0 126 S A #if has no #endif in the same file. MISRA-C:2012(Ed 3 Rev 1) R.20.14
|
|||
|
0 127 S Array has no bounds specified. MISRA-C:2012(Ed 3 Rev 1) R.8.11,R.9.5
|
|||
|
0 128 S Parameter has same name as global variable. MISRA-C:2012(Ed 3 Rev 1) R.5.3
|
|||
|
0 130 S Included file is not permitted. MISRA-C:2012(Ed 3 Rev 1) R.21.5,R.21.6,R.21.10,R.21.11
|
|||
|
0 131 S Name reused in inner scope. MISRA-C:2012(Ed 3 Rev 1) R.5.3
|
|||
|
2 132 S * Assignment operator in boolean expression. MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.4
|
|||
|
0 134 S Volatile variable in complex expression. MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.2
|
|||
|
0 135 S Parameter list is KR. MISRA-C:2012(Ed 3 Rev 1) R.8.1,R.8.2
|
|||
|
0 136 S Bit operator with boolean operand. MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
0 139 S Construct leads to infeasible code. MISRA-C:2012(Ed 3 Rev 1) R.14.3
|
|||
|
0 140 S Infeasible loop condition found. MISRA-C:2012(Ed 3 Rev 1) R.14.3
|
|||
|
0 145 S #if has invalid expression. MISRA-C:2012(Ed 3 Rev 1) R.1.1
|
|||
|
0 147 S Spurious characters after preprocessor directive. MISRA-C:2012(Ed 3 Rev 1) R.20.13
|
|||
|
0 156 S Use of 'defined' keyword in macro body. MISRA-C:2012(Ed 3 Rev 1) R.21.1
|
|||
|
0 157 S Modification of string literal. MISRA-C:2012(Ed 3 Rev 1) R.7.4
|
|||
|
0 172 S Variable declared multiply. MISRA-C:2012(Ed 3 Rev 1) R.8.5
|
|||
|
0 176 S Non standard escape sequence in source. MISRA-C:2012(Ed 3 Rev 1) R.1.3,R.4.1
|
|||
|
0 203 S Cast on a constant value. MISRA-C:2012(Ed 3 Rev 1) R.11.8
|
|||
|
0 218 S Name is used in standard libraries. MISRA-C:2012(Ed 3 Rev 1) R.21.2
|
|||
|
0 219 S User name starts with underscore. MISRA-C:2012(Ed 3 Rev 1) R.21.1,R.21.2
|
|||
|
0 243 S Included file not protected with #define. MISRA-C:2012(Ed 3 Rev 1) D.4.10
|
|||
|
0 245 S Case statement in nested block. MISRA-C:2012(Ed 3 Rev 1) R.16.2
|
|||
|
0 248 S Divide by zero in preprocessor directive. MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
0 249 S Operation not appropriate to boolean type. MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
0 252 S Lower case suffix to literal number. MISRA-C:2012(Ed 3 Rev 1) R.7.3
|
|||
|
0 270 S For loop initialisation is not simple. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
5 271 S * For loop incrementation is not simple. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
0 276 S Case is not part of switch enumeration. MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
0 296 S Function declared at block scope. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 322 S Default is not last case of switch. MISRA-C:2012(Ed 3 Rev 1) R.16.5
|
|||
|
0 323 S Switch has more than one default case. MISRA-C:2012(Ed 3 Rev 1) R.1.1
|
|||
|
0 324 S Macro call has wrong number of parameters. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 325 S Inconsistent use of tag. MISRA-C:2012(Ed 3 Rev 1) R.5.7
|
|||
|
0 326 S Declaration is missing type. MISRA-C:2012(Ed 3 Rev 1) R.8.1
|
|||
|
0 329 S Operation not appropriate to plain char. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2
|
|||
|
5 330 S * Implicit conversion of underlying type (MR). MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
21 331 S * Literal value requires a U suffix. MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
0 332 S Widening cast on complex integer expression (MR). MISRA-C:2012(Ed 3 Rev 1) R.10.8
|
|||
|
0 333 S Widening cast on complex float expression (MR). MISRA-C:2012(Ed 3 Rev 1) R.10.8
|
|||
|
0 335 S Operator defined contains illegal items. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 336 S #if expansion contains define operator. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 337 S Undefined macro variable in #if. MISRA-C:2012(Ed 3 Rev 1) R.20.9
|
|||
|
0 341 S Preprocessor construct as macro parameter. MISRA-C:2012(Ed 3 Rev 1) R.20.6
|
|||
|
0 342 S Extra chars after preprocessor directive. MISRA-C:2012(Ed 3 Rev 1) R.20.13
|
|||
|
0 343 S #else has no #if, etc in the same file. MISRA-C:2012(Ed 3 Rev 1) R.20.14
|
|||
|
0 344 S Cast on volatile value. MISRA-C:2012(Ed 3 Rev 1) R.11.8
|
|||
|
2 345 S * Bit operator with floating point operand. MISRA-C:2012(Ed 3 Rev 1) R.1.1,R.10.1
|
|||
|
29 361 S * Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
0 374 S Name conflict with typedef. MISRA-C:2012(Ed 3 Rev 1) R.5.6
|
|||
|
9 382 S * (void) missing for discarded return value. MISRA-C:2012(Ed 3 Rev 1) R.17.7
|
|||
|
0 383 S Identifier name matches macro name. MISRA-C:2012(Ed 3 Rev 1) R.5.5
|
|||
|
0 384 S Identifier matches macro name in 31 chars. MISRA-C:2012(Ed 3 Rev 1) R.5.4,R.5.5
|
|||
|
0 385 S MISRA switch statement syntax violation. MISRA-C:2012(Ed 3 Rev 1) R.16.1
|
|||
|
0 387 S Enum init not integer-constant-expression. MISRA-C:2012(Ed 3 Rev 1) R.1.1
|
|||
|
0 389 S Bool value incremented/decremented. MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
0 397 S Array initialisation has insufficient items. MISRA-C:2012(Ed 3 Rev 1) R.9.3
|
|||
|
4 403 S * Negative (or potentially negative) shift. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.12.2
|
|||
|
0 404 S Array initialisation has too many items. MISRA-C:2012(Ed 3 Rev 1) R.1.1
|
|||
|
0 406 S Use of ++ or -- on RHS of && or || operator. MISRA-C:2012(Ed 3 Rev 1) R.13.5
|
|||
|
0 408 S Volatile variable accessed on RHS of && or ||. MISRA-C:2012(Ed 3 Rev 1) R.13.5
|
|||
|
0 410 S Switch empty default has no comment (MR). MISRA-C:2012(Ed 3 Rev 1) R.16.4
|
|||
|
0 411 S Inappropriate value assigned to enum. MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
0 412 S Undefined behaviour, \ before E-O-F. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 427 S Filename in #include not in < > or " ". MISRA-C:2012(Ed 3 Rev 1) R.20.3
|
|||
|
0 428 S No {} for switch. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
0 429 S Empty middle expression in for loop. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
0 430 S Inconsistent usage of loop control variable. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
0 431 S Char used instead of (un)signed char. MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
0 432 S Inappropriate type - should be plain char. MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
0 433 S Type conversion without cast. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.11.5
|
|||
|
28 434 S * Signed/unsigned conversion without cast. MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
4 435 S * Float/integer conversion without cast. MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
50 436 S * Declaration does not specify an array. MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
0 437 S < > <= >= used on different object pointers. MISRA-C:2012(Ed 3 Rev 1) R.18.3
|
|||
|
0 438 S Pointer subtraction not addressing one array. MISRA-C:2012(Ed 3 Rev 1) R.18.2
|
|||
|
0 439 S Cast from pointer to integral type. MISRA-C:2012(Ed 3 Rev 1) R.11.2,R.11.4,R.11.6,R.11.7
|
|||
|
0 440 S Cast from integral type to pointer. MISRA-C:2012(Ed 3 Rev 1) R.11.1,R.11.2,R.11.4,R.11.6,R.11.7
|
|||
|
0 441 S Float cast to non-float. MISRA-C:2012(Ed 3 Rev 1) R.10.8
|
|||
|
0 442 S Signed integral type cast to unsigned. MISRA-C:2012(Ed 3 Rev 1) R.10.8
|
|||
|
0 443 S Unsigned integral type cast to signed. MISRA-C:2012(Ed 3 Rev 1) R.10.8
|
|||
|
0 444 S Integral type cast to non-integral. MISRA-C:2012(Ed 3 Rev 1) R.10.8
|
|||
|
0 445 S Narrower float conversion without cast. MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
4 446 S * Narrower int conversion without cast. MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
0 450 S Wide string and string concatenated. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 451 S No cast for widening complex float expression (MR).
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.6,R.10.7
|
|||
|
1 452 S * No cast for widening complex int expression (MR). MISRA-C:2012(Ed 3 Rev 1) R.10.6,R.10.7
|
|||
|
3 458 S * Implicit conversion: actual to formal param (MR). MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
0 461 S Identifier with ambiguous linkage. MISRA-C:2012(Ed 3 Rev 1) R.8.8
|
|||
|
0 465 S Struct/union not completely specified. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 477 S Empty else clause following else if. MISRA-C:2012(Ed 3 Rev 1) R.15.7
|
|||
|
0 481 S Array with no bounds in struct. MISRA-C:2012(Ed 3 Rev 1) R.1.1,R.18.7
|
|||
|
0 482 S Incomplete structure referenced. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 486 S Incorrect number of formats in output function. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 487 S Insufficient space allocated. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 488 S Value outside range of underlying type. MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
0 493 S Numeric overflow. MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14,R.12.4
|
|||
|
0 494 S Numeric underflow. MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14,R.12.4
|
|||
|
1 497 S * Type is incomplete in translation unit. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 506 S Use of boolean with relational operator. MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
0 509 S goto label is backwards. MISRA-C:2012(Ed 3 Rev 1) R.15.2
|
|||
|
1 511 S * Jump into nested block. MISRA-C:2012(Ed 3 Rev 1) R.15.3
|
|||
|
0 520 S Bit field is not bool or explicit integral. MISRA-C:2012(Ed 3 Rev 1) R.6.1
|
|||
|
0 531 S Literal zero used in pointer context. MISRA-C:2012(Ed 3 Rev 1) R.11.9
|
|||
|
2 550 S * Unsuffixed hex or octal is unsigned, add U. MISRA-C:2012(Ed 3 Rev 1) R.7.2
|
|||
|
0 553 S Function and proto should both be static. MISRA-C:2012(Ed 3 Rev 1) R.8.8
|
|||
|
0 554 S Cast to an unrelated type. MISRA-C:2012(Ed 3 Rev 1) R.11.2,R.11.3
|
|||
|
0 565 S Assignment to wider scope. MISRA-C:2012(Ed 3 Rev 1) R.18.6
|
|||
|
4 567 S * Pointer arithmetic is not on array. MISRA-C:2012(Ed 3 Rev 1) R.18.1,R.18.4
|
|||
|
0 573 S Macro concatenation of uni char names. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 575 S Linkage differs from previous declaration. MISRA-C:2012(Ed 3 Rev 1) R.8.8
|
|||
|
0 576 S Function pointer is of wrong type. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 580 S Macro redefinition without using #undef. MISRA-C:2012(Ed 3 Rev 1) R.1.1,R.20.4
|
|||
|
0 581 S Loop conditions are independent. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
0 582 S const object reassigned. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 587 S Const local variable not immediately initialised. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 589 S Format is not appropriate type. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 590 S Mode fault in fopen. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 606 S Cast involving function pointer. MISRA-C:2012(Ed 3 Rev 1) R.11.1
|
|||
|
0 608 S Use of explicitly undefined language feature. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 611 S Line splice used in // comment. MISRA-C:2012(Ed 3 Rev 1) R.3.2
|
|||
|
0 612 S inline function should be declared static. MISRA-C:2012(Ed 3 Rev 1) R.8.10
|
|||
|
0 613 S Use of restrict keyword. MISRA-C:2012(Ed 3 Rev 1) R.8.14
|
|||
|
0 615 S Conditional operator has incompatible types. MISRA-C:2012(Ed 3 Rev 1) R.1.1
|
|||
|
0 616 S Preprocessor result not 0 or 1. MISRA-C:2012(Ed 3 Rev 1) R.20.8
|
|||
|
0 618 S Use of memcmp between structures. MISRA-C:2012(Ed 3 Rev 1) R.21.16
|
|||
|
0 620 S Initialisation designator duplicated. MISRA-C:2012(Ed 3 Rev 1) R.9.4
|
|||
|
1 621 S * Variable-length array declared. MISRA-C:2012(Ed 3 Rev 1) R.18.8
|
|||
|
0 622 S Macro parameters are not unique within limits. MISRA-C:2012(Ed 3 Rev 1) R.5.4
|
|||
|
0 623 S String assigned to non const object. MISRA-C:2012(Ed 3 Rev 1) R.7.4
|
|||
|
0 626 S #define of keyword. MISRA-C:2012(Ed 3 Rev 1) R.20.4
|
|||
|
0 627 S Initialiser both positional and designational. MISRA-C:2012(Ed 3 Rev 1) R.9.4
|
|||
|
0 629 S Divide by zero found. MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
0 630 S Duplicated enumeration value. MISRA-C:2012(Ed 3 Rev 1) R.8.12
|
|||
|
0 635 S Cast from pointer to float type. MISRA-C:2012(Ed 3 Rev 1) R.11.6,R.11.7
|
|||
|
0 636 S Cast from float type to pointer. MISRA-C:2012(Ed 3 Rev 1) R.11.6,R.11.7
|
|||
|
0 637 S # operand followed by ##. MISRA-C:2012(Ed 3 Rev 1) R.20.11
|
|||
|
0 642 S Function return type with array field. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 645 S realloc ptr type does not match target type. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 646 S Struct initialisation has too many items. MISRA-C:2012(Ed 3 Rev 1) R.1.1
|
|||
|
0 649 S Use of unallocated flexible array. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 650 S Flexible array copy ignores last member. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 655 S Standard library copy/compare objects have different types.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.21.15
|
|||
|
0 661 S memcmp used to compare null terminated strings. MISRA-C:2012(Ed 3 Rev 1) R.21.14
|
|||
|
0 662 S EOF compared with char. MISRA-C:2012(Ed 3 Rev 1) R.22.7
|
|||
|
2 692 S * Array index is negative. MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
0 6 D Recursion in procedure calls found. MISRA-C:2012(Ed 3 Rev 1) R.17.2
|
|||
|
2 8 D * DD data flow anomalies found. MISRA-C:2012(Ed 3 Rev 1) R.2.2
|
|||
|
0 17 D Identifier not unique within 31 characters. MISRA-C:2012(Ed 3 Rev 1) R.5.1,R.5.2,R.5.3
|
|||
|
0 18 D Identifier name reused. MISRA-C:2012(Ed 3 Rev 1) R.5.3
|
|||
|
0 26 D Variable should be defined once in only one file. MISRA-C:2012(Ed 3 Rev 1) R.8.6
|
|||
|
0 27 D Variable should be declared static. MISRA-C:2012(Ed 3 Rev 1) R.8.7,R.8.8
|
|||
|
0 28 D Potentially infinite loop found. MISRA-C:2012(Ed 3 Rev 1) R.2.1
|
|||
|
0 33 D No real declaration for external variable. MISRA-C:2012(Ed 3 Rev 1) R.8.6
|
|||
|
0 34 D Procedure name re-used in different files. MISRA-C:2012(Ed 3 Rev 1) R.8.6
|
|||
|
0 35 D Expression has side effects. MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.2,R.13.5
|
|||
|
0 36 D Prototype and definition name mismatch. MISRA-C:2012(Ed 3 Rev 1) R.8.3,R.8.4
|
|||
|
0 42 D Local pointer returned in function result. MISRA-C:2012(Ed 3 Rev 1) R.18.6
|
|||
|
0 43 D Divide by zero found. MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
0 45 D Pointer not checked for null before use. MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
0 49 D File pointer not closed on exit. MISRA-C:2012(Ed 3 Rev 1) R.22.1
|
|||
|
0 50 D Memory not freed after last reference. MISRA-C:2012(Ed 3 Rev 1) R.22.1
|
|||
|
1 55 D * Modification of loop counter in loop body. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
0 60 D External object should be declared only once. MISRA-C:2012(Ed 3 Rev 1) R.8.5
|
|||
|
0 61 D Procedure should be declared static. MISRA-C:2012(Ed 3 Rev 1) R.8.7,R.8.8
|
|||
|
0 63 D No definition in system for prototyped procedure. MISRA-C:2012(Ed 3 Rev 1) R.8.6
|
|||
|
0 65 D Void function has no side effects. MISRA-C:2012(Ed 3 Rev 1) R.2.2
|
|||
|
0 72 D Potential side effect problem in expression. MISRA-C:2012(Ed 3 Rev 1) R.13.2
|
|||
|
0 75 D Attempt to open file pointer more than once. MISRA-C:2012(Ed 3 Rev 1) R.22.1
|
|||
|
0 76 D Procedure is not called or referenced in code analysed.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.2.1
|
|||
|
0 77 D Local structure returned in function result. MISRA-C:2012(Ed 3 Rev 1) R.18.6
|
|||
|
0 82 D fsetpos values not generated by fgetpos. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 83 D Potentially repeated call to ungetc. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 84 D No fseek or flush before I/O. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 85 D Filename not verified before fopen. MISRA-C:2012(Ed 3 Rev 1) D.4.14
|
|||
|
0 86 D User input not checked before use. MISRA-C:2012(Ed 3 Rev 1) D.4.14
|
|||
|
0 87 D Illegal shared object in signal handler. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 89 D Illegal use of raise in signal handler. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 91 D Function return value potentially unused. MISRA-C:2012(Ed 3 Rev 1) D.4.7,R.17.7
|
|||
|
0 103 D File opened both read and write. MISRA-C:2012(Ed 3 Rev 1) R.22.3
|
|||
|
0 105 D DU anomaly dead code, var value is unused on all paths.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.2.2
|
|||
|
16 106 D * No prototype for non-static function. MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
0 110 D More than one prototype for same function. MISRA-C:2012(Ed 3 Rev 1) R.8.5
|
|||
|
0 111 D errno checked without having been set for errno setting fn.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.22.8
|
|||
|
2 115 D * Copy length parameter not checked before use. MISRA-C:2012(Ed 3 Rev 1) D.4.1
|
|||
|
0 121 D errno neither set nor checked for errno setting function.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.22.8,R.22.9
|
|||
|
0 122 D errno not checked after being set for errno setting fn.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.22.9
|
|||
|
0 123 D File pointer not checked for null before use. MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
1 124 D * Var set by std lib func return not checked before use.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.7
|
|||
|
0 127 D Local or member denominator not checked before use.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
0 128 D Global pointer not checked within this procedure. MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
0 129 D Global file pointer not checked within this procedure.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
1 130 D * Global set by std lib func return not checked before use.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.7
|
|||
|
1 131 D * Global denominator not checked within this procedure.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
0 132 D errno checked after call to non-errno setting function.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.22.10
|
|||
|
0 134 D errno not checked before subsequent function call.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.22.9
|
|||
|
0 135 D Pointer assigned to NULL may be dereferenced. MISRA-C:2012(Ed 3 Rev 1) D.4.1
|
|||
|
0 136 D Global pointer assigned to NULL may be dereferenced.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.1
|
|||
|
0 137 D Parameter used as denominator not checked before use.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.1
|
|||
|
0 1 X Declaration types do not match across a system. MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
0 4 X Identifier reuse: struct/union tag repeated. MISRA-C:2012(Ed 3 Rev 1) R.5.7
|
|||
|
0 5 X Identifier reuse: struct vs union. MISRA-C:2012(Ed 3 Rev 1) R.5.7
|
|||
|
0 6 X Identifier reuse: struct/union tag vs enum tag. MISRA-C:2012(Ed 3 Rev 1) R.5.7
|
|||
|
0 7 X Identifier reuse: tag vs procedure. MISRA-C:2012(Ed 3 Rev 1) R.5.7,R.5.8,R.5.9
|
|||
|
0 8 X Identifier reuse: tag vs procedure parameter. MISRA-C:2012(Ed 3 Rev 1) R.5.7
|
|||
|
0 9 X Identifier reuse: tag vs variable. MISRA-C:2012(Ed 3 Rev 1) R.5.7
|
|||
|
0 10 X Identifier reuse: tag vs label (MR). MISRA-C:2012(Ed 3 Rev 1) R.5.7
|
|||
|
0 11 X Identifier reuse: tag vs typedef. MISRA-C:2012(Ed 3 Rev 1) R.5.6,R.5.7
|
|||
|
0 12 X Identifier reuse: tag vs macro. MISRA-C:2012(Ed 3 Rev 1) R.5.5
|
|||
|
0 13 X Identifier reuse: tag vs component. MISRA-C:2012(Ed 3 Rev 1) R.5.7
|
|||
|
0 14 X Identifier reuse: tag vs enum constant. MISRA-C:2012(Ed 3 Rev 1) R.5.7
|
|||
|
0 15 X Identifier reuse: persistent var vs tag. MISRA-C:2012(Ed 3 Rev 1) R.5.7,R.5.8,R.5.9
|
|||
|
0 16 X Identifier reuse: typedef vs variable. MISRA-C:2012(Ed 3 Rev 1) R.5.6
|
|||
|
0 17 X Identifier reuse: typedef vs label (MR). MISRA-C:2012(Ed 3 Rev 1) R.5.6
|
|||
|
0 18 X Identifier reuse: typedef vs typedef. MISRA-C:2012(Ed 3 Rev 1) R.5.6
|
|||
|
0 19 X Identifier reuse: typedef vs procedure parameter. MISRA-C:2012(Ed 3 Rev 1) R.5.6
|
|||
|
0 20 X Identifier reuse: persistent var vs typedef. MISRA-C:2012(Ed 3 Rev 1) R.5.6,R.5.8,R.5.9
|
|||
|
0 21 X Identifier reuse: typedef vs macro. MISRA-C:2012(Ed 3 Rev 1) R.5.5
|
|||
|
0 22 X Identifier reuse: typedef vs component. MISRA-C:2012(Ed 3 Rev 1) R.5.6
|
|||
|
0 23 X Identifier reuse: typedef vs enum constant. MISRA-C:2012(Ed 3 Rev 1) R.5.6
|
|||
|
0 24 X Identifier reuse: typedef vs procedure. MISRA-C:2012(Ed 3 Rev 1) R.5.6,R.5.8,R.5.9
|
|||
|
0 25 X Identifier reuse: procedure vs procedure param. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 26 X Identifier reuse: persistent var vs label (MR). MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 27 X Identifier reuse: persist var vs persist var. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 28 X Identifier reuse: persistent var vs var. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 29 X Identifier reuse: persistent var vs procedure. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 30 X Identifier reuse: persistent var vs proc param. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 31 X Identifier reuse: procedure vs procedure. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 32 X Identifier reuse: procedure vs var. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 33 X Identifier reuse: procedure vs label (MR). MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 34 X Identifier reuse: proc vs macro. MISRA-C:2012(Ed 3 Rev 1) R.5.5
|
|||
|
0 35 X Identifier reuse: proc vs component. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 36 X Identifier reuse: proc vs enum constant. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 37 X Identifier reuse: persistent var vs macro. MISRA-C:2012(Ed 3 Rev 1) R.5.5
|
|||
|
0 38 X Identifier reuse: persistent var vs component. MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 39 X Identifier reuse: persistent var vs enum constant.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.5.8,R.5.9
|
|||
|
0 47 X Identifier reuse: component vs macro. MISRA-C:2012(Ed 3 Rev 1) R.5.5
|
|||
|
0 48 X Identifier reuse: label vs macro (MR). MISRA-C:2012(Ed 3 Rev 1) R.5.5
|
|||
|
0 50 X Identifier reuse: var vs macro. MISRA-C:2012(Ed 3 Rev 1) R.5.5
|
|||
|
0 53 X Identifier reuse: proc param vs macro. MISRA-C:2012(Ed 3 Rev 1) R.5.5
|
|||
|
0 57 X Identifier reuse: macro vs enum constant. MISRA-C:2012(Ed 3 Rev 1) R.5.5
|
|||
|
0 61 X Identifier match in 31 chars. MISRA-C:2012(Ed 3 Rev 1) R.5.1,R.5.2,R.5.3,R.5.4,R.5.5
|
|||
|
0 62 X Function prototype/defn return type mismatch (MR).
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
0 63 X Function prototype/defn param type mismatch (MR). MISRA-C:2012(Ed 3 Rev 1) R.8.3,R.8.4
|
|||
|
0 64 X Array bound exceeded at call. MISRA-C:2012(Ed 3 Rev 1) R.17.5,R.18.1
|
|||
|
0 68 X Parameter indexing array too big at call. MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
0 69 X Global array bound exceeded at use. MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
0 72 X Parameter indexing array too small at call. MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
0 80 X Divide by zero found. MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
1 1 Q * Call has execution order dependant side effects. MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.2,R.13.5
|
|||
|
0 5 Q File does not end with new line. MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
0 1 U Inter-file recursion found. MISRA-C:2012(Ed 3 Rev 1) R.17.2
|
|||
|
0 1 J Unreachable Code found. MISRA-C:2012(Ed 3 Rev 1) R.2.1
|
|||
|
0 3 J All internal linkage calls unreachable. MISRA-C:2012(Ed 3 Rev 1) R.2.1
|
|||
|
|
|||
|
|
|||
|
|
|||
|
==============================================================================================================
|
|||
|
NUMBER OF
|
|||
|
VIOLATIONS LDRA CODE ADVISORY STANDARDS MISRA-C:2012(ED 3 REV 1) CODE
|
|||
|
==============================================================================================================
|
|||
|
1 13 S * goto detected. MISRA-C:2012(Ed 3 Rev 1) R.15.1
|
|||
|
61 49 S * Logical conjunctions need brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1
|
|||
|
0 53 S Use of comma operator. MISRA-C:2012(Ed 3 Rev 1) R.12.3
|
|||
|
0 68 S #undef used. MISRA-C:2012(Ed 3 Rev 1) R.20.5
|
|||
|
0 74 S Union declared. MISRA-C:2012(Ed 3 Rev 1) R.19.2
|
|||
|
0 75 S Executable code before an included file. MISRA-C:2012(Ed 3 Rev 1) R.20.1
|
|||
|
0 80 S Pointer indirection exceeds 2 levels. MISRA-C:2012(Ed 3 Rev 1) R.18.5
|
|||
|
0 81 S Use of trigraph. MISRA-C:2012(Ed 3 Rev 1) R.4.2
|
|||
|
4 87 S * Use of pointer arithmetic. MISRA-C:2012(Ed 3 Rev 1) R.18.4
|
|||
|
62 90 S * Basic type declaration used. MISRA-C:2012(Ed 3 Rev 1) D.4.6
|
|||
|
13 110 S * Use of single line comment(s) //. MISRA-C:2012(Ed 3 Rev 1) R.1.2
|
|||
|
0 143 S Curly brackets used in expression. MISRA-C:2012(Ed 3 Rev 1) R.1.2
|
|||
|
2 149 S * Reference parameter to procedure is reassigned. MISRA-C:2012(Ed 3 Rev 1) R.17.8
|
|||
|
0 217 S Names only differ by case. MISRA-C:2012(Ed 3 Rev 1) D.4.5
|
|||
|
0 293 S Non ANSI/ISO construct used. MISRA-C:2012(Ed 3 Rev 1) R.1.2
|
|||
|
0 302 S Comment possibly contains code. MISRA-C:2012(Ed 3 Rev 1) D.4.4
|
|||
|
0 338 S #include preceded by non preproc directives. MISRA-C:2012(Ed 3 Rev 1) R.20.1
|
|||
|
0 340 S Use of function like macro. MISRA-C:2012(Ed 3 Rev 1) D.4.9
|
|||
|
0 409 S More than one break or goto statement in loop. MISRA-C:2012(Ed 3 Rev 1) R.15.4
|
|||
|
0 413 S User type declared but not used in code analysed. MISRA-C:2012(Ed 3 Rev 1) R.2.3,R.2.4
|
|||
|
0 426 S #undef used in a block. MISRA-C:2012(Ed 3 Rev 1) R.20.5
|
|||
|
0 495 S Typedef name has no size indication. MISRA-C:2012(Ed 3 Rev 1) D.4.6
|
|||
|
0 610 S Label is unused. MISRA-C:2012(Ed 3 Rev 1) R.2.6
|
|||
|
0 628 S Macro not used in translation unit. MISRA-C:2012(Ed 3 Rev 1) R.2.5
|
|||
|
2 632 S * Use of // comment in pre-processor directive or macro defn.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.1.2
|
|||
|
7 7 C * Procedure has more than one exit point. MISRA-C:2012(Ed 3 Rev 1) R.15.5
|
|||
|
0 1 D Unused procedure parameter. MISRA-C:2012(Ed 3 Rev 1) R.2.7
|
|||
|
1 14 D * Attempt to change parameter passed by value. MISRA-C:2012(Ed 3 Rev 1) R.17.8
|
|||
|
0 15 D Unused procedural parameter. MISRA-C:2012(Ed 3 Rev 1) R.2.7
|
|||
|
3 25 D * Scope of variable could be reduced. MISRA-C:2012(Ed 3 Rev 1) R.8.9
|
|||
|
0 104 D Structure implementation not hidden. MISRA-C:2012(Ed 3 Rev 1) D.4.8
|
|||
|
8 120 D * Pointer param should be declared pointer to const.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.13
|
|||
|
1 67 X * Identifier is typographically ambiguous. MISRA-C:2012(Ed 3 Rev 1) D.4.5
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Number of Mandatory Standards checked 34
|
|||
|
Number of Required Standards checked 308
|
|||
|
Number of Advisory Standards checked 33
|
|||
|
Number of Document Standards checked 3
|
|||
|
Total Standards checked 375
|
|||
|
Total Standards checked including Document 378
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
----------------------------------------------------------------------------------------------------
|
|||
|
===============================
|
|||
|
** OVERALL RESULT: FAIL **
|
|||
|
===============================
|
|||
|
----------------------------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
Out of 17 program components, 1 (5.88 %) passes ( of which 1 conditionally passes )
|
|||
|
and 16 fail ( of which 0 fail only because of insufficient comments )
|
|||
|
|
|||
|
|
|||
|
Procedure Results
|
|||
|
-----------------
|
|||
|
=============================================================================================
|
|||
|
CODE REVIEW RESULT PROCEDURE SOURCE FILE UNIQUE VIOLATIONS FAILURE DENSITY
|
|||
|
(VIOLS/R.LINE %)
|
|||
|
=============================================================================================
|
|||
|
Conditional Pass Global Program
|
|||
|
FAIL mode_s_init mode-s.c 4 # 26 ###
|
|||
|
FAIL mode_s_checksum mode-s.c 6 # 67 #######
|
|||
|
FAIL mode_s_msg_len_by_type
|
|||
|
mode-s.c 3 # 48 #####
|
|||
|
FAIL fix_single_bit_errors
|
|||
|
mode-s.c 5 # 47 #####
|
|||
|
FAIL fix_two_bits_errors mode-s.c 5 # 55 ######
|
|||
|
FAIL icao_cache_has_addr mode-s.c 2 # 56 ######
|
|||
|
FAIL add_recently_seen_icao_addr
|
|||
|
mode-s.c 1 # 29 ###
|
|||
|
FAIL icao_addr_was_recently_seen
|
|||
|
mode-s.c 5 # 86 #########
|
|||
|
FAIL brute_force_ap mode-s.c 10 ## 98 ##########
|
|||
|
FAIL decode_ac13_field mode-s.c 7 # 168 ###########
|
|||
|
FAIL decode_ac12_field mode-s.c 7 # 138 ###########
|
|||
|
FAIL mode_s_decode mode-s.c 14 ## 87 #########
|
|||
|
FAIL mode_s_compute_magnitude_vector
|
|||
|
mode-s.c 6 # 75 ########
|
|||
|
FAIL detect_out_of_phase mode-s.c 5 # 54 ######
|
|||
|
FAIL apply_phase_correction
|
|||
|
mode-s.c 4 # 50 ######
|
|||
|
FAIL mode_s_detect mode-s.c 14 ## 53 ######
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Global Information
|
|||
|
------------------
|
|||
|
|
|||
|
Global Basic Information
|
|||
|
------------------------
|
|||
|
Number of procedures: 16
|
|||
|
Number of locally uncalled procedures: 0
|
|||
|
Maximum loop depth: 2
|
|||
|
Total Cyclomatic Complexity: 113
|
|||
|
Number of reformatted executable lines: 918
|
|||
|
Number of lines of comments: 242
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
***********************************************
|
|||
|
* *
|
|||
|
* Detailed Report on all Program Components *
|
|||
|
* *
|
|||
|
***********************************************
|
|||
|
|
|||
|
|
|||
|
**********************************************************
|
|||
|
* *
|
|||
|
* Globals / code outside procedures - Conditional Pass *
|
|||
|
* *
|
|||
|
**********************************************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
===========================================================================
|
|||
|
CODE SRC LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
O 3 Use of // comment in pre-processor directive or macro defn.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.1.2
|
|||
|
Source : #define MODE_S_PREAMBLE_US 8 // microseconds
|
|||
|
|
|||
|
O 8 Use of // comment in pre-processor directive or macro defn.
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.1.2
|
|||
|
Source : #define MODE_S_ICAO_CACHE_TTL 60 // Time to live of cached addresses.
|
|||
|
|
|||
|
O 11 Basic type declaration used. : int maglut_initialized
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.6
|
|||
|
Source : static int maglut_initialized = 0;
|
|||
|
|
|||
|
O Use of single line comment(s) //. MISRA-C:2012(Ed 3 Rev 1) R.1.2
|
|||
|
O 11 Scope of variable could be reduced. : maglut_initialized
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.9
|
|||
|
Source : static int maglut_initialized = 0;
|
|||
|
|
|||
|
O 61 Scope of variable could be reduced. : mode_s_checksum_table
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.9
|
|||
|
Source : uint32_t mode_s_checksum_table[] = {
|
|||
|
|
|||
|
O 309 Scope of variable could be reduced. : ais_charset MISRA-C:2012(Ed 3 Rev 1) R.8.9
|
|||
|
Source : static const char *ais_charset = "?ABCDEFGHIJKLMNOPQRSTUVWXYZ????? ???????????????0123456789??????
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
*************************
|
|||
|
* *
|
|||
|
* mode_s_init *
|
|||
|
* (15 to 40 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
*************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : mode_s_init
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 24 (void) missing for discarded return value. MISRA-C:2012(Ed 3 Rev 1) R.17.7
|
|||
|
Source : memset(&self->icao_cache, 0, sizeof(self->icao_cache));
|
|||
|
|
|||
|
C 32 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (!maglut_initialized) {
|
|||
|
|
|||
|
C 35 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : maglut[i*129+q] = round(sqrt(i*i+q*q)*360);
|
|||
|
|
|||
|
C 35 Float/integer conversion without cast. : (unsigned short and double): maglut [ i * 129 + q ] = round
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : maglut[i*129+q] = round(sqrt(i*i+q*q)*360);
|
|||
|
|
|||
|
C 35 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : maglut[i*129+q] = round(sqrt(i*i+q*q)*360);
|
|||
|
|
|||
|
C 35 Value is not of appropriate type. : (double and short): sqrt ( i * i + q * q )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : maglut[i*129+q] = round(sqrt(i*i+q*q)*360);
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 35
|
|||
|
Maximum loop depth: 2
|
|||
|
Cyclomatic Complexity: 4
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 0
|
|||
|
Number of procedures which this calls: 3
|
|||
|
Number of comments associated with procedure: 9
|
|||
|
Number of comments in procedure header: 1
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
1 (self)->icao_cache
|
|||
|
*
|
|||
|
1 (self)->aggressive
|
|||
|
*
|
|||
|
1 (self)->check_crc
|
|||
|
*
|
|||
|
1 (self)->fix_errors
|
|||
|
*
|
|||
|
1 self *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
*************************
|
|||
|
* *
|
|||
|
* mode_s_checksum *
|
|||
|
* (78 to 93 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
*************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : mode_s_checksum
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 86 Use of shift operator on signed type. : << used with signed char: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int bitmask = 1 << (7-bit);
|
|||
|
|
|||
|
C 86 Implicit conversion of underlying type (MR). : (signed char and int): 1 << ( 7 - bit
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : int bitmask = 1 << (7-bit);
|
|||
|
|
|||
|
C 86 Use of mixed mode arithmetic. : (signed char and int): 1 << ( 7 - bit
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : int bitmask = 1 << (7-bit);
|
|||
|
|
|||
|
C 86 Negative (or potentially negative) shift. : int : ( 7 - bit )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.12.2
|
|||
|
Source : int bitmask = 1 << (7-bit);
|
|||
|
|
|||
|
C 89 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
78
|
|||
|
Source : uint32_t mode_s_checksum(unsigned char *msg, int bits) {
|
|||
|
Source : if (msg[byte] & bitmask)
|
|||
|
|
|||
|
C 89 Use of bit operator on signed type. : & used with int: bitmask
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : if (msg[byte] & bitmask)
|
|||
|
|
|||
|
C 89 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (msg[byte] & bitmask)
|
|||
|
|
|||
|
C 89 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (msg[byte] & bitmask)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 27
|
|||
|
Maximum loop depth: 1
|
|||
|
Cyclomatic Complexity: 4
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 4
|
|||
|
Number of procedures which this calls: 0
|
|||
|
Number of comments associated with procedure: 20
|
|||
|
Number of comments in procedure header: 18
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
2 bits *
|
|||
|
1 msg * *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
****************************
|
|||
|
* *
|
|||
|
* mode_s_msg_len_by_type *
|
|||
|
* (97 to 104 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
****************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : mode_s_msg_len_by_type
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 100 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : type == 21)
|
|||
|
|
|||
|
C 102 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : else
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 23
|
|||
|
Maximum loop depth: 0
|
|||
|
Cyclomatic Complexity: 6
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 2
|
|||
|
Number of procedures which this calls: 0
|
|||
|
Number of comments associated with procedure: 2
|
|||
|
Number of comments in procedure header: 2
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
1 type *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
***************************
|
|||
|
* *
|
|||
|
* fix_single_bit_errors *
|
|||
|
* (109 to 134 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
***************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : fix_single_bit_errors
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 115 Use of shift operator on signed type. : << used with signed char: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int bitmask = 1 << (7-(j%8));
|
|||
|
|
|||
|
C 115 Negative (or potentially negative) shift. : int : ( 7 - ( j % 8 ) )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.12.2
|
|||
|
Source : int bitmask = 1 << (7-(j%8));
|
|||
|
|
|||
|
C 118 (void) missing for discarded return value. MISRA-C:2012(Ed 3 Rev 1) R.17.7
|
|||
|
Source : memcpy(aux, msg, bits/8);
|
|||
|
|
|||
|
C 119 Use of bit operator on signed type. : ^= used with int: bitmask
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : aux[byte] ^= bitmask; // Flip j-th bit.
|
|||
|
|
|||
|
C 119 Signed/unsigned conversion without cast. : (unsigned char and int): aux [ byte ] ^= bitmask
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : aux[byte] ^= bitmask; // Flip j-th bit.
|
|||
|
|
|||
|
C 129 (void) missing for discarded return value. MISRA-C:2012(Ed 3 Rev 1) R.17.7
|
|||
|
Source : memcpy(msg, aux, bits/8);
|
|||
|
|
|||
|
M 118 Copy source parameter not checked before use. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.21.17
|
|||
|
Source : memcpy(aux, msg, bits/8);
|
|||
|
|
|||
|
M 129 Copy source parameter not checked before use. : aux
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.21.17
|
|||
|
Source : memcpy(msg, aux, bits/8);
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 38
|
|||
|
Maximum loop depth: 1
|
|||
|
Cyclomatic Complexity: 3
|
|||
|
Essential Cyclomatic Complexity: 3
|
|||
|
Number of procedures which call this one: 1
|
|||
|
Number of procedures which this calls: 2
|
|||
|
Number of comments associated with procedure: 6
|
|||
|
Number of comments in procedure header: 3
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
2 bits *
|
|||
|
1 msg * * *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
***************************
|
|||
|
* *
|
|||
|
* fix_two_bits_errors *
|
|||
|
* (139 to 175 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
***************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : fix_two_bits_errors
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 145 Use of shift operator on signed type. : << used with signed char: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int bitmask1 = 1 << (7-(j%8));
|
|||
|
|
|||
|
C 145 Negative (or potentially negative) shift. : int : ( 7 - ( j % 8 ) )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.12.2
|
|||
|
Source : int bitmask1 = 1 << (7-(j%8));
|
|||
|
|
|||
|
C 150 Use of shift operator on signed type. : << used with signed char: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int bitmask2 = 1 << (7-(i%8));
|
|||
|
|
|||
|
C 150 Negative (or potentially negative) shift. : int : ( 7 - ( i % 8 ) )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.12.2
|
|||
|
Source : int bitmask2 = 1 << (7-(i%8));
|
|||
|
|
|||
|
C 153 (void) missing for discarded return value. MISRA-C:2012(Ed 3 Rev 1) R.17.7
|
|||
|
Source : memcpy(aux, msg, bits/8);
|
|||
|
|
|||
|
C 155 Use of bit operator on signed type. : ^= used with int: bitmask1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : aux[byte1] ^= bitmask1; // Flip j-th bit.
|
|||
|
|
|||
|
C 155 Signed/unsigned conversion without cast. : (unsigned char and int): aux [ byte1 ] ^= bitmask1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : aux[byte1] ^= bitmask1; // Flip j-th bit.
|
|||
|
|
|||
|
C 156 Use of bit operator on signed type. : ^= used with int: bitmask2
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : aux[byte2] ^= bitmask2; // Flip i-th bit.
|
|||
|
|
|||
|
C 156 Signed/unsigned conversion without cast. : (unsigned char and int): aux [ byte2 ] ^= bitmask2
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : aux[byte2] ^= bitmask2; // Flip i-th bit.
|
|||
|
|
|||
|
C 166 (void) missing for discarded return value. MISRA-C:2012(Ed 3 Rev 1) R.17.7
|
|||
|
Source : memcpy(msg, aux, bits/8);
|
|||
|
|
|||
|
C 170 Use of bit operator on signed type. : | used with int: j
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : return j | (i<<8);
|
|||
|
|
|||
|
C 170 Use of shift operator on signed type. : << used with int: i
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : return j | (i<<8);
|
|||
|
|
|||
|
C 170 Use of bit operator on signed type. : | used with int: ( i << 8 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : return j | (i<<8);
|
|||
|
|
|||
|
M 153 Copy source parameter not checked before use. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.21.17
|
|||
|
Source : memcpy(aux, msg, bits/8);
|
|||
|
|
|||
|
M 166 Copy source parameter not checked before use. : aux
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.21.17
|
|||
|
Source : memcpy(msg, aux, bits/8);
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 49
|
|||
|
Maximum loop depth: 2
|
|||
|
Cyclomatic Complexity: 4
|
|||
|
Essential Cyclomatic Complexity: 4
|
|||
|
Number of procedures which call this one: 1
|
|||
|
Number of procedures which this calls: 2
|
|||
|
Number of comments associated with procedure: 11
|
|||
|
Number of comments in procedure header: 3
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
2 bits *
|
|||
|
1 msg * * *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
***************************
|
|||
|
* *
|
|||
|
* icao_cache_has_addr *
|
|||
|
* (179 to 186 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
***************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : icao_cache_has_addr
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 182 Literal value requires a U suffix. : 0x45d9f3b
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : a = ((a >> 16) ^ a) * 0x45d9f3b;
|
|||
|
|
|||
|
C 183 Literal value requires a U suffix. : 0x45d9f3b
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : a = ((a >> 16) ^ a) * 0x45d9f3b;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 9
|
|||
|
Maximum loop depth: 0
|
|||
|
Cyclomatic Complexity: 1
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 2
|
|||
|
Number of procedures which this calls: 0
|
|||
|
Number of comments associated with procedure: 4
|
|||
|
Number of comments in procedure header: 2
|
|||
|
Number of comments in declarations: 2
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
1 a * *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
*********************************
|
|||
|
* *
|
|||
|
* add_recently_seen_icao_addr *
|
|||
|
* (191 to 195 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
*********************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : add_recently_seen_icao_addr
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 194 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : self->icao_cache[h*2+1] = (uint32_t) time(NULL);
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 7
|
|||
|
Maximum loop depth: 0
|
|||
|
Cyclomatic Complexity: 1
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 1
|
|||
|
Number of procedures which this calls: 2
|
|||
|
Number of comments associated with procedure: 3
|
|||
|
Number of comments in procedure header: 3
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
2 addr *
|
|||
|
1 (self)->icao_cache
|
|||
|
*
|
|||
|
1 self *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
*********************************
|
|||
|
* *
|
|||
|
* icao_addr_was_recently_seen *
|
|||
|
* (200 to 206 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
*********************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : icao_addr_was_recently_seen
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 203 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : int32_t t = self->icao_cache[h*2+1];
|
|||
|
|
|||
|
C 205 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : return a && a == addr && time(NULL)-t <= MODE_S_ICAO_CACHE_TTL;
|
|||
|
|
|||
|
C 205 Signed/unsigned conversion without cast. : (unsigned int and int): ) - t
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : return a && a == addr && time(NULL)-t <= MODE_S_ICAO_CACHE_TTL;
|
|||
|
|
|||
|
C 205 Use of mixed mode arithmetic. : (unsigned int and int): ) - t
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : return a && a == addr && time(NULL)-t <= MODE_S_ICAO_CACHE_TTL;
|
|||
|
|
|||
|
C 205 Literal value requires a U suffix. : 60 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : return a && a == addr && time(NULL)-t <= MODE_S_ICAO_CACHE_TTL;
|
|||
|
|
|||
|
C 205 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : return a && a == addr && time(NULL)-t <= MODE_S_ICAO_CACHE_TTL;
|
|||
|
|
|||
|
C 205 Use of mixed mode arithmetic. : (unsigned int and signed char): ) - t <= 60
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : return a && a == addr && time(NULL)-t <= MODE_S_ICAO_CACHE_TTL;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 14
|
|||
|
Maximum loop depth: 0
|
|||
|
Cyclomatic Complexity: 3
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 1
|
|||
|
Number of procedures which this calls: 2
|
|||
|
Number of comments associated with procedure: 3
|
|||
|
Number of comments in procedure header: 3
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
2 addr *
|
|||
|
1 (self)->icao_cache *
|
|||
|
1 self *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
***************************
|
|||
|
* *
|
|||
|
* brute_force_ap *
|
|||
|
* (223 to 263 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
***************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : brute_force_ap
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 224 Variable-length array declared. : aux[*]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.8
|
|||
|
Source : unsigned char aux[MODE_S_LONG_MSG_BYTES];
|
|||
|
|
|||
|
C 241 (void) missing for discarded return value. MISRA-C:2012(Ed 3 Rev 1) R.17.7
|
|||
|
Source : memcpy(aux, msg, msgbits/8);
|
|||
|
|
|||
|
C 248 Implicit conversion of underlying type (MR). : (unsigned char and unsigned int): aux [ lastbyte ] ^= crc
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : aux[lastbyte] ^= crc & 0xff;
|
|||
|
|
|||
|
C 248 Narrower int conversion without cast. : (unsigned char and unsigned int): aux [ lastbyte ] ^= crc
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
Source : aux[lastbyte] ^= crc & 0xff;
|
|||
|
|
|||
|
C 248 Literal value requires a U suffix. : 0xff
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : aux[lastbyte] ^= crc & 0xff;
|
|||
|
|
|||
|
C 248 Use of bit operator on signed type. : & used with int: 0xff
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : aux[lastbyte] ^= crc & 0xff;
|
|||
|
|
|||
|
C 249 Implicit conversion of underlying type (MR). : (unsigned char and unsigned int): aux [ lastbyte - 1 ] ^= ( crc >> 8
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : aux[lastbyte-1] ^= (crc >> 8) & 0xff;
|
|||
|
|
|||
|
C 249 Narrower int conversion without cast. : (unsigned char and unsigned int): aux [ lastbyte - 1 ] ^= ( crc >> 8
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
Source : aux[lastbyte-1] ^= (crc >> 8) & 0xff;
|
|||
|
|
|||
|
C 249 Literal value requires a U suffix. : 0xff
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : aux[lastbyte-1] ^= (crc >> 8) & 0xff;
|
|||
|
|
|||
|
C 249 Use of bit operator on signed type. : & used with int: 0xff
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : aux[lastbyte-1] ^= (crc >> 8) & 0xff;
|
|||
|
|
|||
|
C 250 Implicit conversion of underlying type (MR). : (unsigned char and unsigned int): aux [ lastbyte - 2 ] ^= ( crc >> 16
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : aux[lastbyte-2] ^= (crc >> 16) & 0xff;
|
|||
|
|
|||
|
C 250 Narrower int conversion without cast. : (unsigned char and unsigned int): aux [ lastbyte - 2 ] ^= ( crc >> 16
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
Source : aux[lastbyte-2] ^= (crc >> 16) & 0xff;
|
|||
|
|
|||
|
C 250 Literal value requires a U suffix. : 0xff
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : aux[lastbyte-2] ^= (crc >> 16) & 0xff;
|
|||
|
|
|||
|
C 250 Use of bit operator on signed type. : & used with int: 0xff
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : aux[lastbyte-2] ^= (crc >> 16) & 0xff;
|
|||
|
|
|||
|
C 254 No cast for widening complex int expression (MR). : (unsigned int and unsigned char): addr = aux
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.6,R.10.7
|
|||
|
Source : addr = aux[lastbyte] | (aux[lastbyte-1] << 8) | (aux[lastbyte-2] << 16);
|
|||
|
|
|||
|
C 254 Shifting value too far. MISRA-C:2012(Ed 3 Rev 1) R.12.2
|
|||
|
Source : addr = aux[lastbyte] | (aux[lastbyte-1] << 8) | (aux[lastbyte-2] << 16);
|
|||
|
|
|||
|
C 255 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (icao_addr_was_recently_seen(self, addr)) {
|
|||
|
|
|||
|
C 256 Signed/unsigned conversion without cast. : (int and unsigned char): mm -> aa1 = aux
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : mm->aa1 = aux[lastbyte-2];
|
|||
|
|
|||
|
C 257 Signed/unsigned conversion without cast. : (int and unsigned char): mm -> aa2 = aux
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : mm->aa2 = aux[lastbyte-1];
|
|||
|
|
|||
|
C 258 Signed/unsigned conversion without cast. : (int and unsigned char): mm -> aa3 = aux
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : mm->aa3 = aux[lastbyte];
|
|||
|
|
|||
|
C 223 Type is incomplete in translation unit. : mode_s_msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.1.3
|
|||
|
Source : int brute_force_ap(mode_s_t *self, unsigned char *msg, struct mode_s_msg *mm) {
|
|||
|
|
|||
|
M 241 Copy source parameter not checked before use. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.21.17
|
|||
|
Source : memcpy(aux, msg, msgbits/8);
|
|||
|
|
|||
|
C 241 Copy length parameter not checked before use. : msgbits
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.1
|
|||
|
Source : memcpy(aux, msg, msgbits/8);
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 42
|
|||
|
Maximum loop depth: 0
|
|||
|
Cyclomatic Complexity: 9
|
|||
|
Essential Cyclomatic Complexity: 3
|
|||
|
Number of procedures which call this one: 1
|
|||
|
Number of procedures which this calls: 3
|
|||
|
Number of comments associated with procedure: 23
|
|||
|
Number of comments in procedure header: 15
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
3 (mm)->aa3 * *
|
|||
|
3 (mm)->aa2 * *
|
|||
|
3 (mm)->aa1 * *
|
|||
|
3 (mm)->msgbits *
|
|||
|
3 (mm)->msgtype *
|
|||
|
3 mm *
|
|||
|
2 msg * *
|
|||
|
1 (self)->icao_cache * *
|
|||
|
1 self * *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
***************************
|
|||
|
* *
|
|||
|
* decode_ac13_field *
|
|||
|
* (267 to 290 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
***************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : decode_ac13_field
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 268 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
267
|
|||
|
Source : int decode_ac13_field(unsigned char *msg, int *unit) {
|
|||
|
Source : int m_bit = msg[3] & (1<<6);
|
|||
|
|
|||
|
C 268 Signed/unsigned conversion without cast. : (int and unsigned char): msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : int m_bit = msg[3] & (1<<6);
|
|||
|
|
|||
|
C 268 Use of shift operator on signed type. : << used with signed char: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int m_bit = msg[3] & (1<<6);
|
|||
|
|
|||
|
C 268 Use of bit operator on signed type. : & used with signed char: ( 1 << 6 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int m_bit = msg[3] & (1<<6);
|
|||
|
|
|||
|
C 269 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
267
|
|||
|
Source : int decode_ac13_field(unsigned char *msg, int *unit) {
|
|||
|
Source : int q_bit = msg[3] & (1<<4);
|
|||
|
|
|||
|
C 269 Signed/unsigned conversion without cast. : (int and unsigned char): msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : int q_bit = msg[3] & (1<<4);
|
|||
|
|
|||
|
C 269 Use of shift operator on signed type. : << used with signed char: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int q_bit = msg[3] & (1<<4);
|
|||
|
|
|||
|
C 269 Use of bit operator on signed type. : & used with signed char: ( 1 << 4 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int q_bit = msg[3] & (1<<4);
|
|||
|
|
|||
|
C 271 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (!m_bit) {
|
|||
|
|
|||
|
C 273 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (q_bit) {
|
|||
|
|
|||
|
C 275 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
267
|
|||
|
Source : int decode_ac13_field(unsigned char *msg, int *unit) {
|
|||
|
Source : int n = ((msg[2]&31)<<6) |
|
|||
|
|
|||
|
C 275 Value is not of appropriate type. : (unsigned char and signed char): ( msg [ 2 ] &
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : int n = ((msg[2]&31)<<6) |
|
|||
|
|
|||
|
C 275 Use of bit operator on signed type. : & used with int: 31
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int n = ((msg[2]&31)<<6) |
|
|||
|
|
|||
|
C 275 Use of shift operator on signed type. : << used with signed char: ( msg [ 2 ] & 31 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int n = ((msg[2]&31)<<6) |
|
|||
|
|
|||
|
C 275 Use of bit operator on signed type. : | used with signed char: ( ( msg [ 2 ] & 31 ) << 6 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int n = ((msg[2]&31)<<6) |
|
|||
|
|
|||
|
C 276 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
267
|
|||
|
Source : int decode_ac13_field(unsigned char *msg, int *unit) {
|
|||
|
Source : ((msg[3]&0x80)>>2) |
|
|||
|
|
|||
|
C 276 Unsuffixed hex or octal is unsigned, add U. : 0x80
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.7.2
|
|||
|
Source : ((msg[3]&0x80)>>2) |
|
|||
|
|
|||
|
C 276 Value is not of appropriate type. : (unsigned char and signed char): ( msg [ 3 ] &
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : ((msg[3]&0x80)>>2) |
|
|||
|
|
|||
|
C 276 Use of bit operator on signed type. : & used with int: 0x80
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3]&0x80)>>2) |
|
|||
|
|
|||
|
C 276 Use of shift operator on signed type. : >> used with signed char: ( msg [ 3 ] & 0x80 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3]&0x80)>>2) |
|
|||
|
|
|||
|
C 276 Use of bit operator on signed type. : | used with signed char: ( ( msg [ 3 ] & 0x80 ) >> 2 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3]&0x80)>>2) |
|
|||
|
|
|||
|
C 278 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
267
|
|||
|
Source : int decode_ac13_field(unsigned char *msg, int *unit) {
|
|||
|
Source : (msg[3]&15);
|
|||
|
|
|||
|
C 278 Value is not of appropriate type. : (unsigned char and signed char): ( msg [ 3 ] &
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : (msg[3]&15);
|
|||
|
|
|||
|
C 278 Use of bit operator on signed type. : & used with int: 0x20
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : (msg[3]&15);
|
|||
|
|
|||
|
C 278 Use of shift operator on signed type. : >> used with signed char: ( msg [ 3 ] & 0x20 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : (msg[3]&15);
|
|||
|
|
|||
|
C 278 Use of bit operator on signed type. : | used with signed char: ( ( msg [ 3 ] & 0x20 ) >> 1 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : (msg[3]&15);
|
|||
|
|
|||
|
C 278 Signed/unsigned conversion without cast. : (signed char and unsigned char): ( msg [ 3 ] & 0x20 ) >> 1 ) | ( msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : (msg[3]&15);
|
|||
|
|
|||
|
C 278 Value is not of appropriate type. : (unsigned char and signed char): ( msg [ 3 ] & 0x20 ) >> 1 ) | ( msg [ 3 ] &
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : (msg[3]&15);
|
|||
|
|
|||
|
C 278 Use of bit operator on signed type. : & used with int: 15
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : (msg[3]&15);
|
|||
|
|
|||
|
C 278 Use of bit operator on signed type. : | used with signed char: ( msg [ 3 ] & 15 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : (msg[3]&15);
|
|||
|
|
|||
|
C 281 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : return n*25-1000;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 25
|
|||
|
Maximum loop depth: 0
|
|||
|
Cyclomatic Complexity: 3
|
|||
|
Essential Cyclomatic Complexity: 3
|
|||
|
Number of procedures which call this one: 1
|
|||
|
Number of procedures which this calls: 0
|
|||
|
Number of comments associated with procedure: 7
|
|||
|
Number of comments in procedure header: 2
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
2 *(unit) *
|
|||
|
2 unit *
|
|||
|
1 msg *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
***************************
|
|||
|
* *
|
|||
|
* decode_ac12_field *
|
|||
|
* (294 to 307 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
***************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : decode_ac12_field
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 295 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
294
|
|||
|
Source : int decode_ac12_field(unsigned char *msg, int *unit) {
|
|||
|
Source : int q_bit = msg[5] & 1;
|
|||
|
|
|||
|
C 295 Signed/unsigned conversion without cast. : (int and unsigned char): msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : int q_bit = msg[5] & 1;
|
|||
|
|
|||
|
C 295 Value is not of appropriate type. : (unsigned char and signed char): msg [ 5 ] &
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : int q_bit = msg[5] & 1;
|
|||
|
|
|||
|
C 295 Use of bit operator on signed type. : & used with int: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int q_bit = msg[5] & 1;
|
|||
|
|
|||
|
C 297 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (q_bit) {
|
|||
|
|
|||
|
C 300 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
294
|
|||
|
Source : int decode_ac12_field(unsigned char *msg, int *unit) {
|
|||
|
Source : int n = ((msg[5]>>1)<<4) | ((msg[6]&0xF0) >> 4);
|
|||
|
|
|||
|
C 300 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
294
|
|||
|
Source : int decode_ac12_field(unsigned char *msg, int *unit) {
|
|||
|
Source : int n = ((msg[5]>>1)<<4) | ((msg[6]&0xF0) >> 4);
|
|||
|
|
|||
|
C 300 Unsuffixed hex or octal is unsigned, add U. : 0xF0
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.7.2
|
|||
|
Source : int n = ((msg[5]>>1)<<4) | ((msg[6]&0xF0) >> 4);
|
|||
|
|
|||
|
C 300 Value is not of appropriate type. : (unsigned char and signed char): ( msg [ 6 ] &
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : int n = ((msg[5]>>1)<<4) | ((msg[6]&0xF0) >> 4);
|
|||
|
|
|||
|
C 300 Use of bit operator on signed type. : & used with int: 0xF0
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int n = ((msg[5]>>1)<<4) | ((msg[6]&0xF0) >> 4);
|
|||
|
|
|||
|
C 300 Use of shift operator on signed type. : >> used with signed char: ( msg [ 6 ] & 0xF0 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int n = ((msg[5]>>1)<<4) | ((msg[6]&0xF0) >> 4);
|
|||
|
|
|||
|
C 300 Use of bit operator on signed type. : | used with signed char: ( ( msg [ 6 ] & 0xF0 ) >> 4 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : int n = ((msg[5]>>1)<<4) | ((msg[6]&0xF0) >> 4);
|
|||
|
|
|||
|
C 303 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : return n*25-1000;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 16
|
|||
|
Maximum loop depth: 0
|
|||
|
Cyclomatic Complexity: 2
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 1
|
|||
|
Number of procedures which this calls: 0
|
|||
|
Number of comments associated with procedure: 5
|
|||
|
Number of comments in procedure header: 2
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
2 *(unit) * *
|
|||
|
2 unit * *
|
|||
|
1 msg *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
***************************
|
|||
|
* *
|
|||
|
* mode_s_decode *
|
|||
|
* (313 to 486 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
***************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : mode_s_decode
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
C DD data flow anomalies found. MISRA-C:2012(Ed 3 Rev 1) R.2.2
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 317 (void) missing for discarded return value. MISRA-C:2012(Ed 3 Rev 1) R.17.7
|
|||
|
Source : memcpy(mm->msg, msg, MODE_S_LONG_MSG_BYTES);
|
|||
|
|
|||
|
C 321 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
313
|
|||
|
Source : void mode_s_decode(mode_s_t *self, struct mode_s_msg *mm, unsigned char *msg) {
|
|||
|
Source : mm->msgtype = msg[0]>>3; // Downlink Format
|
|||
|
|
|||
|
C 321 Signed/unsigned conversion without cast. : (int and unsigned char): mm -> msgtype = msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : mm->msgtype = msg[0]>>3; // Downlink Format
|
|||
|
|
|||
|
C 325 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
313
|
|||
|
Source : void mode_s_decode(mode_s_t *self, struct mode_s_msg *mm, unsigned char *msg) {
|
|||
|
Source : mm->crc = ((uint32_t)msg[(mm->msgbits/8)-3] << 16) |
|
|||
|
|
|||
|
C 326 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
313
|
|||
|
Source : void mode_s_decode(mode_s_t *self, struct mode_s_msg *mm, unsigned char *msg) {
|
|||
|
Source : ((uint32_t)msg[(mm->msgbits/8)-2] << 8) |
|
|||
|
|
|||
|
C 326 Declaration does not specify an array. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
313
|
|||
|
Source : void mode_s_decode(mode_s_t *self, struct mode_s_msg *mm, unsigned char *msg) {
|
|||
|
Source : ((uint32_t)msg[(mm->msgbits/8)-2] << 8) |
|
|||
|
|
|||
|
C 334 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (!mm->crcok && self->fix_errors && (mm->msgtype == 11 || mm->msgtype == 17)) {
|
|||
|
|
|||
|
C 334 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (!mm->crcok && self->fix_errors && (mm->msgtype == 11 || mm->msgtype == 17)) {
|
|||
|
|
|||
|
C 335 Assignment operation in expression. MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.2,R.13.4
|
|||
|
Source : if ((mm->errorbit = fix_single_bit_errors(msg, mm->msgbits)) != -1) {
|
|||
|
|
|||
|
C 335 Assignment operator in boolean expression. MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.4
|
|||
|
Source : if ((mm->errorbit = fix_single_bit_errors(msg, mm->msgbits)) != -1) {
|
|||
|
|
|||
|
C 336 Signed/unsigned conversion without cast. : (int and unsigned int): mode_s_checksum
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : mm->crc = mode_s_checksum(msg, mm->msgbits);
|
|||
|
|
|||
|
C 338 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : } else if (self->aggressive && mm->msgtype == 17 &&
|
|||
|
|
|||
|
C 339 Assignment operation in expression. MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.2,R.13.4
|
|||
|
Source : (mm->errorbit = fix_two_bits_errors(msg, mm->msgbits)) != -1) {
|
|||
|
|
|||
|
C 339 Assignment operator in boolean expression. MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.4
|
|||
|
Source : (mm->errorbit = fix_two_bits_errors(msg, mm->msgbits)) != -1) {
|
|||
|
|
|||
|
C 340 Signed/unsigned conversion without cast. : (int and unsigned int): mode_s_checksum
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : mm->crc = mode_s_checksum(msg, mm->msgbits);
|
|||
|
|
|||
|
C 342 Else alternative missing in if. MISRA-C:2012(Ed 3 Rev 1) R.15.7
|
|||
|
Source : }
|
|||
|
|
|||
|
C 348 Use of bit operator on signed type. : & used with int: msg [ 0 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ca = msg[0] & 7; // Responder capabilities.
|
|||
|
|
|||
|
C 348 Use of bit operator on signed type. : & used with int: 7
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ca = msg[0] & 7; // Responder capabilities.
|
|||
|
|
|||
|
C 356 Use of shift operator on signed type. : >> used with int: msg [ 4 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->metype = msg[4] >> 3; // Extended squitter message type.
|
|||
|
|
|||
|
C 357 Use of bit operator on signed type. : & used with int: msg [ 4 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->mesub = msg[4] & 7; // Extended squitter message subtype.
|
|||
|
|
|||
|
C 357 Use of bit operator on signed type. : & used with int: 7
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->mesub = msg[4] & 7; // Extended squitter message subtype.
|
|||
|
|
|||
|
C 360 Use of bit operator on signed type. : & used with int: msg [ 0 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->fs = msg[0] & 7; // Flight status for DF4,5,20,21
|
|||
|
|
|||
|
C 360 Use of bit operator on signed type. : & used with int: 7
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->fs = msg[0] & 7; // Flight status for DF4,5,20,21
|
|||
|
|
|||
|
C 361 Use of shift operator on signed type. : >> used with int: msg [ 1 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->dr = msg[1] >> 3 & 31; // Request extraction of downlink request.
|
|||
|
|
|||
|
C 361 Use of bit operator on signed type. : & used with int: msg [ 1 ] >> 3
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->dr = msg[1] >> 3 & 31; // Request extraction of downlink request.
|
|||
|
|
|||
|
C 361 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : mm->dr = msg[1] >> 3 & 31; // Request extraction of downlink request.
|
|||
|
|
|||
|
C 361 Use of bit operator on signed type. : & used with int: 31
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->dr = msg[1] >> 3 & 31; // Request extraction of downlink request.
|
|||
|
|
|||
|
C 362 Use of bit operator on signed type. : & used with int: msg [ 1 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->um = ((msg[1] & 7)<<3)| // Request extraction of downlink request.
|
|||
|
|
|||
|
C 362 Use of bit operator on signed type. : & used with int: 7
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->um = ((msg[1] & 7)<<3)| // Request extraction of downlink request.
|
|||
|
|
|||
|
C 362 Use of shift operator on signed type. : << used with int: ( msg [ 1 ] & 7 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->um = ((msg[1] & 7)<<3)| // Request extraction of downlink request.
|
|||
|
|
|||
|
C 362 Use of bit operator on signed type. : | used with int: ( ( msg [ 1 ] & 7 ) << 3 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->um = ((msg[1] & 7)<<3)| // Request extraction of downlink request.
|
|||
|
|
|||
|
C 363 Use of bit operator on signed type. : | used with int: msg [ 2 ] >> 5
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : msg[2]>>5;
|
|||
|
|
|||
|
C 363 Use of shift operator on signed type. : >> used with int: msg [ 2 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : msg[2]>>5;
|
|||
|
|
|||
|
C 363 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : msg[2]>>5;
|
|||
|
|
|||
|
C 380 Use of bit operator on signed type. : & used with int: msg [ 3 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : a = ((msg[3] & 0x80) >> 5) |
|
|||
|
|
|||
|
C 380 Use of bit operator on signed type. : & used with int: 0x80
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : a = ((msg[3] & 0x80) >> 5) |
|
|||
|
|
|||
|
C 380 Use of shift operator on signed type. : >> used with int: ( msg [ 3 ] & 0x80 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : a = ((msg[3] & 0x80) >> 5) |
|
|||
|
|
|||
|
C 380 Use of bit operator on signed type. : | used with int: ( ( msg [ 3 ] & 0x80 ) >> 5 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : a = ((msg[3] & 0x80) >> 5) |
|
|||
|
|
|||
|
C 381 Use of bit operator on signed type. : & used with int: msg [ 2 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x02) >> 0) |
|
|||
|
|
|||
|
C 381 Use of bit operator on signed type. : & used with int: 0x02
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x02) >> 0) |
|
|||
|
|
|||
|
C 381 Use of shift operator on signed type. : >> used with int: ( msg [ 2 ] & 0x02 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x02) >> 0) |
|
|||
|
|
|||
|
C 381 Use of bit operator on signed type. : | used with int: ( ( msg [ 2 ] & 0x02 ) >> 0 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x02) >> 0) |
|
|||
|
|
|||
|
C 382 Use of bit operator on signed type. : & used with int: msg [ 2 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x08) >> 3);
|
|||
|
|
|||
|
C 382 Use of bit operator on signed type. : & used with int: 0x08
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x08) >> 3);
|
|||
|
|
|||
|
C 382 Use of shift operator on signed type. : >> used with int: ( msg [ 2 ] & 0x08 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x08) >> 3);
|
|||
|
|
|||
|
C 382 Use of bit operator on signed type. : | used with int: ( ( msg [ 2 ] & 0x08 ) >> 3 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x08) >> 3);
|
|||
|
|
|||
|
C 383 Use of bit operator on signed type. : & used with int: msg [ 3 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : b = ((msg[3] & 0x02) << 1) |
|
|||
|
|
|||
|
C 383 Use of bit operator on signed type. : & used with int: 0x02
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : b = ((msg[3] & 0x02) << 1) |
|
|||
|
|
|||
|
C 383 Use of shift operator on signed type. : << used with int: ( msg [ 3 ] & 0x02 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : b = ((msg[3] & 0x02) << 1) |
|
|||
|
|
|||
|
C 383 Use of bit operator on signed type. : | used with int: ( ( msg [ 3 ] & 0x02 ) << 1 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : b = ((msg[3] & 0x02) << 1) |
|
|||
|
|
|||
|
C 384 Use of bit operator on signed type. : & used with int: msg [ 3 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x08) >> 2) |
|
|||
|
|
|||
|
C 384 Use of bit operator on signed type. : & used with int: 0x08
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x08) >> 2) |
|
|||
|
|
|||
|
C 384 Use of shift operator on signed type. : >> used with int: ( msg [ 3 ] & 0x08 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x08) >> 2) |
|
|||
|
|
|||
|
C 384 Use of bit operator on signed type. : | used with int: ( ( msg [ 3 ] & 0x08 ) >> 2 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x08) >> 2) |
|
|||
|
|
|||
|
C 385 Use of bit operator on signed type. : & used with int: msg [ 3 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x20) >> 5);
|
|||
|
|
|||
|
C 385 Use of bit operator on signed type. : & used with int: 0x20
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x20) >> 5);
|
|||
|
|
|||
|
C 385 Use of shift operator on signed type. : >> used with int: ( msg [ 3 ] & 0x20 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x20) >> 5);
|
|||
|
|
|||
|
C 385 Use of bit operator on signed type. : | used with int: ( ( msg [ 3 ] & 0x20 ) >> 5 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x20) >> 5);
|
|||
|
|
|||
|
C 386 Use of bit operator on signed type. : & used with int: msg [ 2 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : c = ((msg[2] & 0x01) << 2) |
|
|||
|
|
|||
|
C 386 Use of bit operator on signed type. : & used with int: 0x01
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : c = ((msg[2] & 0x01) << 2) |
|
|||
|
|
|||
|
C 386 Use of shift operator on signed type. : << used with int: ( msg [ 2 ] & 0x01 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : c = ((msg[2] & 0x01) << 2) |
|
|||
|
|
|||
|
C 386 Use of bit operator on signed type. : | used with int: ( ( msg [ 2 ] & 0x01 ) << 2 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : c = ((msg[2] & 0x01) << 2) |
|
|||
|
|
|||
|
C 387 Use of bit operator on signed type. : & used with int: msg [ 2 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x04) >> 1) |
|
|||
|
|
|||
|
C 387 Use of bit operator on signed type. : & used with int: 0x04
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x04) >> 1) |
|
|||
|
|
|||
|
C 387 Use of shift operator on signed type. : >> used with int: ( msg [ 2 ] & 0x04 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x04) >> 1) |
|
|||
|
|
|||
|
C 387 Use of bit operator on signed type. : | used with int: ( ( msg [ 2 ] & 0x04 ) >> 1 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x04) >> 1) |
|
|||
|
|
|||
|
C 388 Use of bit operator on signed type. : & used with int: msg [ 2 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x10) >> 4);
|
|||
|
|
|||
|
C 388 Use of bit operator on signed type. : & used with int: 0x10
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x10) >> 4);
|
|||
|
|
|||
|
C 388 Use of shift operator on signed type. : >> used with int: ( msg [ 2 ] & 0x10 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x10) >> 4);
|
|||
|
|
|||
|
C 388 Use of bit operator on signed type. : | used with int: ( ( msg [ 2 ] & 0x10 ) >> 4 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[2] & 0x10) >> 4);
|
|||
|
|
|||
|
C 389 Use of bit operator on signed type. : & used with int: msg [ 3 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : d = ((msg[3] & 0x01) << 2) |
|
|||
|
|
|||
|
C 389 Use of bit operator on signed type. : & used with int: 0x01
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : d = ((msg[3] & 0x01) << 2) |
|
|||
|
|
|||
|
C 389 Use of shift operator on signed type. : << used with int: ( msg [ 3 ] & 0x01 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : d = ((msg[3] & 0x01) << 2) |
|
|||
|
|
|||
|
C 389 Use of bit operator on signed type. : | used with int: ( ( msg [ 3 ] & 0x01 ) << 2 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : d = ((msg[3] & 0x01) << 2) |
|
|||
|
|
|||
|
C 390 Use of bit operator on signed type. : & used with int: msg [ 3 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x04) >> 1) |
|
|||
|
|
|||
|
C 390 Use of bit operator on signed type. : & used with int: 0x04
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x04) >> 1) |
|
|||
|
|
|||
|
C 390 Use of shift operator on signed type. : >> used with int: ( msg [ 3 ] & 0x04 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x04) >> 1) |
|
|||
|
|
|||
|
C 390 Use of bit operator on signed type. : | used with int: ( ( msg [ 3 ] & 0x04 ) >> 1 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x04) >> 1) |
|
|||
|
|
|||
|
C 391 Use of bit operator on signed type. : & used with int: msg [ 3 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x10) >> 4);
|
|||
|
|
|||
|
C 391 Use of bit operator on signed type. : & used with int: 0x10
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x10) >> 4);
|
|||
|
|
|||
|
C 391 Use of shift operator on signed type. : >> used with int: ( msg [ 3 ] & 0x10 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x10) >> 4);
|
|||
|
|
|||
|
C 391 Use of bit operator on signed type. : | used with int: ( ( msg [ 3 ] & 0x10 ) >> 4 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : ((msg[3] & 0x10) >> 4);
|
|||
|
|
|||
|
C 392 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : mm->identity = a*1000 + b*100 + c*10 + d;
|
|||
|
|
|||
|
C 401 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (brute_force_ap(self, msg, mm)) {
|
|||
|
|
|||
|
C 410 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (mm->crcok && mm->errorbit == -1) {
|
|||
|
|
|||
|
C 411 Use of shift operator on signed type. : << used with int: mm -> aa1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : uint32_t addr = (mm->aa1 << 16) | (mm->aa2 << 8) | mm->aa3;
|
|||
|
|
|||
|
C 411 Use of bit operator on signed type. : | used with int: ( mm -> aa1 << 16 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : uint32_t addr = (mm->aa1 << 16) | (mm->aa2 << 8) | mm->aa3;
|
|||
|
|
|||
|
C 411 Use of shift operator on signed type. : << used with int: mm -> aa2
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : uint32_t addr = (mm->aa1 << 16) | (mm->aa2 << 8) | mm->aa3;
|
|||
|
|
|||
|
C 411 Use of bit operator on signed type. : | used with int: ( mm -> aa2 << 8 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : uint32_t addr = (mm->aa1 << 16) | (mm->aa2 << 8) | mm->aa3;
|
|||
|
|
|||
|
C 429 Use of shift operator on signed type. : >> used with int: msg [ 5 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[0] = (ais_charset)[msg[5]>>2];
|
|||
|
|
|||
|
C 430 Declaration does not specify an array. : ais_charset
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
309
|
|||
|
Source : static const char *ais_charset = "?ABCDEFGHIJKLMNOPQRSTUVWXYZ????? ???????????????0123456789??????
|
|||
|
Source : mm->flight[1] = ais_charset[((msg[5]&3)<<4)|(msg[6]>>4)];
|
|||
|
|
|||
|
C 430 Use of bit operator on signed type. : & used with int: msg [ 5 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[1] = ais_charset[((msg[5]&3)<<4)|(msg[6]>>4)];
|
|||
|
|
|||
|
C 430 Use of bit operator on signed type. : & used with int: 3
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[1] = ais_charset[((msg[5]&3)<<4)|(msg[6]>>4)];
|
|||
|
|
|||
|
C 430 Use of shift operator on signed type. : << used with int: ( msg [ 5 ] & 3 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[1] = ais_charset[((msg[5]&3)<<4)|(msg[6]>>4)];
|
|||
|
|
|||
|
C 430 Use of bit operator on signed type. : | used with int: ( ( msg [ 5 ] & 3 ) << 4 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[1] = ais_charset[((msg[5]&3)<<4)|(msg[6]>>4)];
|
|||
|
|
|||
|
C 430 Use of shift operator on signed type. : >> used with int: msg [ 6 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[1] = ais_charset[((msg[5]&3)<<4)|(msg[6]>>4)];
|
|||
|
|
|||
|
C 430 Use of bit operator on signed type. : | used with int: ( msg [ 6 ] >> 4 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[1] = ais_charset[((msg[5]&3)<<4)|(msg[6]>>4)];
|
|||
|
|
|||
|
C 431 Declaration does not specify an array. : ais_charset
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
309
|
|||
|
Source : static const char *ais_charset = "?ABCDEFGHIJKLMNOPQRSTUVWXYZ????? ???????????????0123456789??????
|
|||
|
Source : mm->flight[2] = ais_charset[((msg[6]&15)<<2)|(msg[7]>>6)];
|
|||
|
|
|||
|
C 431 Use of bit operator on signed type. : & used with int: msg [ 6 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[2] = ais_charset[((msg[6]&15)<<2)|(msg[7]>>6)];
|
|||
|
|
|||
|
C 431 Use of bit operator on signed type. : & used with int: 15
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[2] = ais_charset[((msg[6]&15)<<2)|(msg[7]>>6)];
|
|||
|
|
|||
|
C 431 Use of shift operator on signed type. : << used with int: ( msg [ 6 ] & 15 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[2] = ais_charset[((msg[6]&15)<<2)|(msg[7]>>6)];
|
|||
|
|
|||
|
C 431 Use of bit operator on signed type. : | used with int: ( ( msg [ 6 ] & 15 ) << 2 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[2] = ais_charset[((msg[6]&15)<<2)|(msg[7]>>6)];
|
|||
|
|
|||
|
C 431 Use of shift operator on signed type. : >> used with int: msg [ 7 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[2] = ais_charset[((msg[6]&15)<<2)|(msg[7]>>6)];
|
|||
|
|
|||
|
C 431 Use of bit operator on signed type. : | used with int: ( msg [ 7 ] >> 6 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[2] = ais_charset[((msg[6]&15)<<2)|(msg[7]>>6)];
|
|||
|
|
|||
|
C 432 Declaration does not specify an array. : ais_charset
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
309
|
|||
|
Source : static const char *ais_charset = "?ABCDEFGHIJKLMNOPQRSTUVWXYZ????? ???????????????0123456789??????
|
|||
|
Source : mm->flight[3] = ais_charset[msg[7]&63];
|
|||
|
|
|||
|
C 432 Use of bit operator on signed type. : & used with int: msg [ 7 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[3] = ais_charset[msg[7]&63];
|
|||
|
|
|||
|
C 432 Use of bit operator on signed type. : & used with int: 63
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[3] = ais_charset[msg[7]&63];
|
|||
|
|
|||
|
C 433 Declaration does not specify an array. : ais_charset
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
309
|
|||
|
Source : static const char *ais_charset = "?ABCDEFGHIJKLMNOPQRSTUVWXYZ????? ???????????????0123456789??????
|
|||
|
Source : mm->flight[4] = ais_charset[msg[8]>>2];
|
|||
|
|
|||
|
C 433 Use of shift operator on signed type. : >> used with int: msg [ 8 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[4] = ais_charset[msg[8]>>2];
|
|||
|
|
|||
|
C 434 Declaration does not specify an array. : ais_charset
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
309
|
|||
|
Source : static const char *ais_charset = "?ABCDEFGHIJKLMNOPQRSTUVWXYZ????? ???????????????0123456789??????
|
|||
|
Source : mm->flight[5] = ais_charset[((msg[8]&3)<<4)|(msg[9]>>4)];
|
|||
|
|
|||
|
C 434 Use of bit operator on signed type. : & used with int: msg [ 8 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[5] = ais_charset[((msg[8]&3)<<4)|(msg[9]>>4)];
|
|||
|
|
|||
|
C 434 Use of bit operator on signed type. : & used with int: 3
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[5] = ais_charset[((msg[8]&3)<<4)|(msg[9]>>4)];
|
|||
|
|
|||
|
C 434 Use of shift operator on signed type. : << used with int: ( msg [ 8 ] & 3 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[5] = ais_charset[((msg[8]&3)<<4)|(msg[9]>>4)];
|
|||
|
|
|||
|
C 434 Use of bit operator on signed type. : | used with int: ( ( msg [ 8 ] & 3 ) << 4 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[5] = ais_charset[((msg[8]&3)<<4)|(msg[9]>>4)];
|
|||
|
|
|||
|
C 434 Use of shift operator on signed type. : >> used with int: msg [ 9 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[5] = ais_charset[((msg[8]&3)<<4)|(msg[9]>>4)];
|
|||
|
|
|||
|
C 434 Use of bit operator on signed type. : | used with int: ( msg [ 9 ] >> 4 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[5] = ais_charset[((msg[8]&3)<<4)|(msg[9]>>4)];
|
|||
|
|
|||
|
C 435 Declaration does not specify an array. : ais_charset
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
309
|
|||
|
Source : static const char *ais_charset = "?ABCDEFGHIJKLMNOPQRSTUVWXYZ????? ???????????????0123456789??????
|
|||
|
Source : mm->flight[6] = ais_charset[((msg[9]&15)<<2)|(msg[10]>>6)];
|
|||
|
|
|||
|
C 435 Use of bit operator on signed type. : & used with int: msg [ 9 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[6] = ais_charset[((msg[9]&15)<<2)|(msg[10]>>6)];
|
|||
|
|
|||
|
C 435 Use of bit operator on signed type. : & used with int: 15
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[6] = ais_charset[((msg[9]&15)<<2)|(msg[10]>>6)];
|
|||
|
|
|||
|
C 435 Use of shift operator on signed type. : << used with int: ( msg [ 9 ] & 15 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[6] = ais_charset[((msg[9]&15)<<2)|(msg[10]>>6)];
|
|||
|
|
|||
|
C 435 Use of bit operator on signed type. : | used with int: ( ( msg [ 9 ] & 15 ) << 2 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[6] = ais_charset[((msg[9]&15)<<2)|(msg[10]>>6)];
|
|||
|
|
|||
|
C 435 Use of shift operator on signed type. : >> used with int: msg [ 10 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[6] = ais_charset[((msg[9]&15)<<2)|(msg[10]>>6)];
|
|||
|
|
|||
|
C 435 Use of bit operator on signed type. : | used with int: ( msg [ 10 ] >> 6 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[6] = ais_charset[((msg[9]&15)<<2)|(msg[10]>>6)];
|
|||
|
|
|||
|
C 436 Declaration does not specify an array. : ais_charset
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
309
|
|||
|
Source : static const char *ais_charset = "?ABCDEFGHIJKLMNOPQRSTUVWXYZ????? ???????????????0123456789??????
|
|||
|
Source : mm->flight[7] = ais_charset[msg[10]&63];
|
|||
|
|
|||
|
C 436 Use of bit operator on signed type. : & used with int: msg [ 10 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[7] = ais_charset[msg[10]&63];
|
|||
|
|
|||
|
C 436 Use of bit operator on signed type. : & used with int: 63
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->flight[7] = ais_charset[msg[10]&63];
|
|||
|
|
|||
|
C 440 Use of bit operator on signed type. : & used with int: msg [ 6 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->fflag = msg[6] & (1<<2);
|
|||
|
|
|||
|
C 440 Use of shift operator on signed type. : << used with signed char: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->fflag = msg[6] & (1<<2);
|
|||
|
|
|||
|
C 440 Use of bit operator on signed type. : & used with int: ( 1 << 2 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->fflag = msg[6] & (1<<2);
|
|||
|
|
|||
|
C 441 Use of bit operator on signed type. : & used with int: msg [ 6 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->tflag = msg[6] & (1<<3);
|
|||
|
|
|||
|
C 441 Use of shift operator on signed type. : << used with signed char: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->tflag = msg[6] & (1<<3);
|
|||
|
|
|||
|
C 441 Use of bit operator on signed type. : & used with int: ( 1 << 3 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->tflag = msg[6] & (1<<3);
|
|||
|
|
|||
|
C 443 Use of bit operator on signed type. : & used with int: msg [ 6 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_latitude = ((msg[6] & 3) << 15) |
|
|||
|
|
|||
|
C 443 Use of bit operator on signed type. : & used with int: 3
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_latitude = ((msg[6] & 3) << 15) |
|
|||
|
|
|||
|
C 443 Use of shift operator on signed type. : << used with int: ( msg [ 6 ] & 3 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_latitude = ((msg[6] & 3) << 15) |
|
|||
|
|
|||
|
C 443 Use of bit operator on signed type. : | used with int: ( ( msg [ 6 ] & 3 ) << 15 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_latitude = ((msg[6] & 3) << 15) |
|
|||
|
|
|||
|
C 443 Use of shift operator on signed type. : << used with int: msg [ 7 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_latitude = ((msg[6] & 3) << 15) |
|
|||
|
|
|||
|
C 443 Use of bit operator on signed type. : | used with int: ( msg [ 7 ] << 7 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_latitude = ((msg[6] & 3) << 15) |
|
|||
|
|
|||
|
C 443 Use of shift operator on signed type. : >> used with int: msg [ 8 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_latitude = ((msg[6] & 3) << 15) |
|
|||
|
|
|||
|
C 443 Use of bit operator on signed type. : | used with int: ( msg [ 8 ] >> 1 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_latitude = ((msg[6] & 3) << 15) |
|
|||
|
|
|||
|
C 446 Use of bit operator on signed type. : & used with int: msg [ 8 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_longitude = ((msg[8]&1) << 16) |
|
|||
|
|
|||
|
C 446 Use of bit operator on signed type. : & used with int: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_longitude = ((msg[8]&1) << 16) |
|
|||
|
|
|||
|
C 446 Use of shift operator on signed type. : << used with int: ( msg [ 8 ] & 1 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_longitude = ((msg[8]&1) << 16) |
|
|||
|
|
|||
|
C 446 Use of bit operator on signed type. : | used with int: ( ( msg [ 8 ] & 1 ) << 16 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_longitude = ((msg[8]&1) << 16) |
|
|||
|
|
|||
|
C 446 Use of shift operator on signed type. : << used with int: msg [ 9 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_longitude = ((msg[8]&1) << 16) |
|
|||
|
|
|||
|
C 446 Use of bit operator on signed type. : | used with int: ( msg [ 9 ] << 8 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_longitude = ((msg[8]&1) << 16) |
|
|||
|
|
|||
|
C 446 Use of bit operator on signed type. : | used with int: msg [ 10 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->raw_longitude = ((msg[8]&1) << 16) |
|
|||
|
|
|||
|
C 452 Use of bit operator on signed type. : & used with int: msg [ 5 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ew_dir = (msg[5]&4) >> 2;
|
|||
|
|
|||
|
C 452 Use of bit operator on signed type. : & used with int: 4
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ew_dir = (msg[5]&4) >> 2;
|
|||
|
|
|||
|
C 452 Use of shift operator on signed type. : >> used with int: ( msg [ 5 ] & 4 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ew_dir = (msg[5]&4) >> 2;
|
|||
|
|
|||
|
C 453 Use of bit operator on signed type. : & used with int: msg [ 5 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ew_velocity = ((msg[5]&3) << 8) | msg[6];
|
|||
|
|
|||
|
C 453 Use of bit operator on signed type. : & used with int: 3
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ew_velocity = ((msg[5]&3) << 8) | msg[6];
|
|||
|
|
|||
|
C 453 Use of shift operator on signed type. : << used with int: ( msg [ 5 ] & 3 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ew_velocity = ((msg[5]&3) << 8) | msg[6];
|
|||
|
|
|||
|
C 453 Use of bit operator on signed type. : | used with int: ( ( msg [ 5 ] & 3 ) << 8 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ew_velocity = ((msg[5]&3) << 8) | msg[6];
|
|||
|
|
|||
|
C 453 Use of bit operator on signed type. : | used with int: msg [ 6 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ew_velocity = ((msg[5]&3) << 8) | msg[6];
|
|||
|
|
|||
|
C 454 Use of bit operator on signed type. : & used with int: msg [ 7 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_dir = (msg[7]&0x80) >> 7;
|
|||
|
|
|||
|
C 454 Use of bit operator on signed type. : & used with int: 0x80
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_dir = (msg[7]&0x80) >> 7;
|
|||
|
|
|||
|
C 454 Use of shift operator on signed type. : >> used with int: ( msg [ 7 ] & 0x80 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_dir = (msg[7]&0x80) >> 7;
|
|||
|
|
|||
|
C 455 Use of bit operator on signed type. : & used with int: msg [ 7 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_velocity = ((msg[7]&0x7f) << 3) | ((msg[8]&0xe0) >> 5);
|
|||
|
|
|||
|
C 455 Use of bit operator on signed type. : & used with int: 0x7f
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_velocity = ((msg[7]&0x7f) << 3) | ((msg[8]&0xe0) >> 5);
|
|||
|
|
|||
|
C 455 Use of shift operator on signed type. : << used with int: ( msg [ 7 ] & 0x7f )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_velocity = ((msg[7]&0x7f) << 3) | ((msg[8]&0xe0) >> 5);
|
|||
|
|
|||
|
C 455 Use of bit operator on signed type. : | used with int: ( ( msg [ 7 ] & 0x7f ) << 3 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_velocity = ((msg[7]&0x7f) << 3) | ((msg[8]&0xe0) >> 5);
|
|||
|
|
|||
|
C 455 Use of bit operator on signed type. : & used with int: msg [ 8 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_velocity = ((msg[7]&0x7f) << 3) | ((msg[8]&0xe0) >> 5);
|
|||
|
|
|||
|
C 455 Use of bit operator on signed type. : & used with int: 0xe0
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_velocity = ((msg[7]&0x7f) << 3) | ((msg[8]&0xe0) >> 5);
|
|||
|
|
|||
|
C 455 Use of shift operator on signed type. : >> used with int: ( msg [ 8 ] & 0xe0 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_velocity = ((msg[7]&0x7f) << 3) | ((msg[8]&0xe0) >> 5);
|
|||
|
|
|||
|
C 455 Use of bit operator on signed type. : | used with int: ( ( msg [ 8 ] & 0xe0 ) >> 5 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->ns_velocity = ((msg[7]&0x7f) << 3) | ((msg[8]&0xe0) >> 5);
|
|||
|
|
|||
|
C 456 Use of bit operator on signed type. : & used with int: msg [ 8 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate_source = (msg[8]&0x10) >> 4;
|
|||
|
|
|||
|
C 456 Use of bit operator on signed type. : & used with int: 0x10
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate_source = (msg[8]&0x10) >> 4;
|
|||
|
|
|||
|
C 456 Use of shift operator on signed type. : >> used with int: ( msg [ 8 ] & 0x10 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate_source = (msg[8]&0x10) >> 4;
|
|||
|
|
|||
|
C 457 Use of bit operator on signed type. : & used with int: msg [ 8 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate_sign = (msg[8]&0x8) >> 3;
|
|||
|
|
|||
|
C 457 Use of bit operator on signed type. : & used with int: 0x8
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate_sign = (msg[8]&0x8) >> 3;
|
|||
|
|
|||
|
C 457 Use of shift operator on signed type. : >> used with int: ( msg [ 8 ] & 0x8 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate_sign = (msg[8]&0x8) >> 3;
|
|||
|
|
|||
|
C 458 Use of bit operator on signed type. : & used with int: msg [ 8 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate = ((msg[8]&7) << 6) | ((msg[9]&0xfc) >> 2);
|
|||
|
|
|||
|
C 458 Use of bit operator on signed type. : & used with int: 7
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate = ((msg[8]&7) << 6) | ((msg[9]&0xfc) >> 2);
|
|||
|
|
|||
|
C 458 Use of shift operator on signed type. : << used with int: ( msg [ 8 ] & 7 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate = ((msg[8]&7) << 6) | ((msg[9]&0xfc) >> 2);
|
|||
|
|
|||
|
C 458 Use of bit operator on signed type. : | used with int: ( ( msg [ 8 ] & 7 ) << 6 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate = ((msg[8]&7) << 6) | ((msg[9]&0xfc) >> 2);
|
|||
|
|
|||
|
C 458 Use of bit operator on signed type. : & used with int: msg [ 9 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate = ((msg[8]&7) << 6) | ((msg[9]&0xfc) >> 2);
|
|||
|
|
|||
|
C 458 Use of bit operator on signed type. : & used with int: 0xfc
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate = ((msg[8]&7) << 6) | ((msg[9]&0xfc) >> 2);
|
|||
|
|
|||
|
C 458 Use of shift operator on signed type. : >> used with int: ( msg [ 9 ] & 0xfc )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate = ((msg[8]&7) << 6) | ((msg[9]&0xfc) >> 2);
|
|||
|
|
|||
|
C 458 Use of bit operator on signed type. : | used with int: ( ( msg [ 9 ] & 0xfc ) >> 2 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->vert_rate = ((msg[8]&7) << 6) | ((msg[9]&0xfc) >> 2);
|
|||
|
|
|||
|
C 460 Float/integer conversion without cast. : (int and double): mm -> velocity = sqrt
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : mm->velocity = sqrt(mm->ns_velocity*mm->ns_velocity+
|
|||
|
|
|||
|
C 460 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : mm->velocity = sqrt(mm->ns_velocity*mm->ns_velocity+
|
|||
|
|
|||
|
C 462 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (mm->velocity) {
|
|||
|
|
|||
|
C 467 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (mm->ew_dir) ewv *= -1;
|
|||
|
|
|||
|
C 467 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (mm->ew_dir) ewv *= -1;
|
|||
|
|
|||
|
C 468 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (mm->ns_dir) nsv *= -1;
|
|||
|
|
|||
|
C 468 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (mm->ns_dir) nsv *= -1;
|
|||
|
|
|||
|
C 472 Float/integer conversion without cast. : (int and double): mm -> heading = heading
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : mm->heading = heading * 360 / (M_PI*2);
|
|||
|
|
|||
|
C 472 Value is not of appropriate type. : (double and short): mm -> heading = heading
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : mm->heading = heading * 360 / (M_PI*2);
|
|||
|
|
|||
|
C 472 Value is not of appropriate type. : (double and signed char): ( M_PI
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : mm->heading = heading * 360 / (M_PI*2);
|
|||
|
|
|||
|
C 474 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (mm->heading < 0) mm->heading += 360;
|
|||
|
|
|||
|
C 479 Use of bit operator on signed type. : & used with int: msg [ 5 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->heading_is_valid = msg[5] & (1<<2);
|
|||
|
|
|||
|
C 479 Use of shift operator on signed type. : << used with signed char: 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->heading_is_valid = msg[5] & (1<<2);
|
|||
|
|
|||
|
C 479 Use of bit operator on signed type. : & used with int: ( 1 << 2 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->heading_is_valid = msg[5] & (1<<2);
|
|||
|
|
|||
|
C 480 Value is not of appropriate type. : (int and double): mm -> heading = ( 360.0 /
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : mm->heading = (360.0/128) * (((msg[5] & 3) << 5) |
|
|||
|
|
|||
|
C 480 Value is not of appropriate type. : (double and short): mm -> heading = ( 360.0
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : mm->heading = (360.0/128) * (((msg[5] & 3) << 5) |
|
|||
|
|
|||
|
C 480 Float/integer conversion without cast. : (int and double): 128
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : mm->heading = (360.0/128) * (((msg[5] & 3) << 5) |
|
|||
|
|
|||
|
C 480 Use of bit operator on signed type. : & used with int: msg [ 5 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->heading = (360.0/128) * (((msg[5] & 3) << 5) |
|
|||
|
|
|||
|
C 480 Use of bit operator on signed type. : & used with int: 3
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->heading = (360.0/128) * (((msg[5] & 3) << 5) |
|
|||
|
|
|||
|
C 480 Use of mixed mode arithmetic. : (double and int): ( msg [ 5 ] & 3
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : mm->heading = (360.0/128) * (((msg[5] & 3) << 5) |
|
|||
|
|
|||
|
C 480 Bit operator with floating point operand. : << used with double: ( msg [ 5 ] & 3 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.1.1,R.10.1
|
|||
|
Source : mm->heading = (360.0/128) * (((msg[5] & 3) << 5) |
|
|||
|
|
|||
|
C 480 Bit operator with floating point operand. : | used with double: ( ( msg [ 5 ] & 3 ) << 5 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.1.1,R.10.1
|
|||
|
Source : mm->heading = (360.0/128) * (((msg[5] & 3) << 5) |
|
|||
|
|
|||
|
C 480 Use of shift operator on signed type. : >> used with int: msg [ 6 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->heading = (360.0/128) * (((msg[5] & 3) << 5) |
|
|||
|
|
|||
|
C 480 Use of bit operator on signed type. : | used with int: ( msg [ 6 ] >> 3 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1
|
|||
|
Source : mm->heading = (360.0/128) * (((msg[5] & 3) << 5) |
|
|||
|
|
|||
|
C 482 Else alternative missing in if. MISRA-C:2012(Ed 3 Rev 1) R.15.7
|
|||
|
Source : }
|
|||
|
|
|||
|
C 483 Else alternative missing in if. MISRA-C:2012(Ed 3 Rev 1) R.15.7
|
|||
|
Source : }
|
|||
|
|
|||
|
C 401 Implicit conversion: actual to formal param (MR). : (int and unsigned char): param 2
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
223
|
|||
|
Source : int brute_force_ap(mode_s_t *self, unsigned char *msg, struct mode_s_msg *mm) {
|
|||
|
Source : if (brute_force_ap(self, msg, mm)) {
|
|||
|
|
|||
|
C 419 Implicit conversion: actual to formal param (MR). : (int and unsigned char): param 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
267
|
|||
|
Source : int decode_ac13_field(unsigned char *msg, int *unit) {
|
|||
|
Source : mm->altitude = decode_ac13_field(msg, &mm->unit);
|
|||
|
|
|||
|
C 442 Implicit conversion: actual to formal param (MR). : (int and unsigned char): param 1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
294
|
|||
|
Source : int decode_ac12_field(unsigned char *msg, int *unit) {
|
|||
|
Source : mm->altitude = decode_ac12_field(msg, &mm->unit);
|
|||
|
|
|||
|
C 339 Call has execution order dependant side effects. : fix_two_bits_errors
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.13.1,R.13.2,R.13.5
|
|||
|
Source : (mm->errorbit = fix_two_bits_errors(msg, mm->msgbits)) != -1) {
|
|||
|
|
|||
|
M 317 Copy source parameter not checked before use. : msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.21.17
|
|||
|
Source : memcpy(mm->msg, msg, MODE_S_LONG_MSG_BYTES);
|
|||
|
|
|||
|
C 317 Copy length parameter not checked before use. : MODE_S_LONG_MSG_BYTES
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.1
|
|||
|
Source : memcpy(mm->msg, msg, MODE_S_LONG_MSG_BYTES);
|
|||
|
|
|||
|
C 472 Var set by std lib func return not checked before use. : heading
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.7
|
|||
|
469
|
|||
|
Source : heading = atan2(ewv, nsv);
|
|||
|
465
|
|||
|
Source : double heading;
|
|||
|
Source : mm->heading = heading * 360 / (M_PI*2);
|
|||
|
|
|||
|
C 472 Global denominator not checked within this procedure. : M_PI
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.1,D.4.14
|
|||
|
Source : mm->heading = heading * 360 / (M_PI*2);
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Calls to functions with side effects in unsuitable locations
|
|||
|
------------------------------------------------------------
|
|||
|
=======================================
|
|||
|
LINE SIDE EFFECT FUNCTION
|
|||
|
=======================================
|
|||
|
339 Parameter fix_two_bits_errors
|
|||
|
Source: (mm->errorbit = fix_two_bits_errors(msg, mm->msgbits)) != -1) {
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 285
|
|||
|
Maximum loop depth: 0
|
|||
|
Cyclomatic Complexity: 34
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 1
|
|||
|
Number of procedures which this calls: 11
|
|||
|
Number of comments associated with procedure: 51
|
|||
|
Number of comments in procedure header: 2
|
|||
|
Number of comments in declarations: 2
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
3 msg * *
|
|||
|
2 (mm)->phase_corrected
|
|||
|
*
|
|||
|
2 (mm)->heading_is_valid
|
|||
|
* *
|
|||
|
2 (mm)->heading * *
|
|||
|
2 (mm)->velocity * *
|
|||
|
2 (mm)->vert_rate
|
|||
|
* *
|
|||
|
2 (mm)->vert_rate_sign
|
|||
|
* *
|
|||
|
2 (mm)->vert_rate_source
|
|||
|
* *
|
|||
|
2 (mm)->ns_velocity
|
|||
|
* *
|
|||
|
2 (mm)->ns_dir * *
|
|||
|
2 (mm)->ew_velocity
|
|||
|
* *
|
|||
|
2 (mm)->ew_dir * *
|
|||
|
2 (mm)->raw_longitude
|
|||
|
* *
|
|||
|
2 (mm)->raw_latitude
|
|||
|
* *
|
|||
|
2 (mm)->tflag * *
|
|||
|
2 (mm)->fflag * *
|
|||
|
2 (mm)->flight * *
|
|||
|
2 (mm)->aircraft_type
|
|||
|
* *
|
|||
|
2 (mm)->unit * *
|
|||
|
2 (mm)->altitude * *
|
|||
|
2 (mm)->identity *
|
|||
|
2 (mm)->um *
|
|||
|
2 (mm)->dr *
|
|||
|
2 (mm)->fs *
|
|||
|
2 (mm)->mesub *
|
|||
|
2 (mm)->metype *
|
|||
|
2 (mm)->aa3 *
|
|||
|
2 (mm)->aa2 *
|
|||
|
2 (mm)->aa1 *
|
|||
|
2 (mm)->ca *
|
|||
|
2 (mm)->crcok *
|
|||
|
2 (mm)->errorbit *
|
|||
|
2 (mm)->crc *
|
|||
|
2 (mm)->msgbits *
|
|||
|
2 (mm)->msgtype *
|
|||
|
2 (mm)->msg * *
|
|||
|
2 mm *
|
|||
|
1 (self)->icao_cache
|
|||
|
* * *
|
|||
|
1 (self)->aggressive * *
|
|||
|
1 (self)->fix_errors * *
|
|||
|
1 self * *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
*************************************
|
|||
|
* *
|
|||
|
* mode_s_compute_magnitude_vector *
|
|||
|
* (489 to 502 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
*************************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : mode_s_compute_magnitude_vector
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 494 Literal value requires a U suffix. : 0 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : for (j = 0; j < size; j += 2) {
|
|||
|
|
|||
|
C 494 Signed/unsigned conversion without cast. : (unsigned int and int): j
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : for (j = 0; j < size; j += 2) {
|
|||
|
|
|||
|
C 494 For loop incrementation is not simple. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
Source : for (j = 0; j < size; j += 2) {
|
|||
|
|
|||
|
C 494 Literal value requires a U suffix. : 2 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : for (j = 0; j < size; j += 2) {
|
|||
|
|
|||
|
C 495 Declaration does not specify an array. : data
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
489
|
|||
|
Source : void mode_s_compute_magnitude_vector(unsigned char *data, uint16_t *mag, uint32_t size) {
|
|||
|
Source : int i = data[j]-127;
|
|||
|
|
|||
|
C 495 Signed/unsigned conversion without cast. : (int and unsigned char): data
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : int i = data[j]-127;
|
|||
|
|
|||
|
C 495 Use of mixed mode arithmetic. : (unsigned char and signed char): data [ j ] - 127
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : int i = data[j]-127;
|
|||
|
|
|||
|
C 496 Declaration does not specify an array. : data
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
489
|
|||
|
Source : void mode_s_compute_magnitude_vector(unsigned char *data, uint16_t *mag, uint32_t size) {
|
|||
|
Source : int q = data[j+1]-127;
|
|||
|
|
|||
|
C 496 Signed/unsigned conversion without cast. : (int and unsigned char): data
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : int q = data[j+1]-127;
|
|||
|
|
|||
|
C 496 Use of mixed mode arithmetic. : (unsigned char and signed char): data [ j + 1 ] - 127
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : int q = data[j+1]-127;
|
|||
|
|
|||
|
C 498 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (i < 0) i = -i;
|
|||
|
|
|||
|
C 499 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (q < 0) q = -q;
|
|||
|
|
|||
|
C 500 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
489
|
|||
|
Source : void mode_s_compute_magnitude_vector(unsigned char *data, uint16_t *mag, uint32_t size) {
|
|||
|
Source : mag[j/2] = maglut[i*129+q];
|
|||
|
|
|||
|
C 500 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : mag[j/2] = maglut[i*129+q];
|
|||
|
|
|||
|
C 500 Global set by std lib func return not checked before use. : maglut
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) D.4.7
|
|||
|
10
|
|||
|
Source : static uint16_t maglut[129*129*2];
|
|||
|
Source : mag[j/2] = maglut[i*129+q];
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 28
|
|||
|
Maximum loop depth: 1
|
|||
|
Cyclomatic Complexity: 4
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 0
|
|||
|
Number of procedures which this calls: 0
|
|||
|
Number of comments associated with procedure: 3
|
|||
|
Number of comments in procedure header: 1
|
|||
|
Number of comments in declarations: 2
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
3 size *
|
|||
|
2 mag * *
|
|||
|
1 data * *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
***************************
|
|||
|
* *
|
|||
|
* detect_out_of_phase *
|
|||
|
* (510 to 516 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
***************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : detect_out_of_phase
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 511 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
510
|
|||
|
Source : int detect_out_of_phase(uint16_t *mag) {
|
|||
|
Source : if (mag[3] > mag[2]/3) return 1;
|
|||
|
|
|||
|
C 511 Literal value requires a U suffix. : 3 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : if (mag[3] > mag[2]/3) return 1;
|
|||
|
|
|||
|
C 511 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : if (mag[3] > mag[2]/3) return 1;
|
|||
|
|
|||
|
C 511 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (mag[3] > mag[2]/3) return 1;
|
|||
|
|
|||
|
C 512 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
510
|
|||
|
Source : int detect_out_of_phase(uint16_t *mag) {
|
|||
|
Source : if (mag[10] > mag[9]/3) return 1;
|
|||
|
|
|||
|
C 512 Literal value requires a U suffix. : 3 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : if (mag[10] > mag[9]/3) return 1;
|
|||
|
|
|||
|
C 512 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : if (mag[10] > mag[9]/3) return 1;
|
|||
|
|
|||
|
C 512 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (mag[10] > mag[9]/3) return 1;
|
|||
|
|
|||
|
C 513 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
510
|
|||
|
Source : int detect_out_of_phase(uint16_t *mag) {
|
|||
|
Source : if (mag[6] > mag[7]/3) return -1;
|
|||
|
|
|||
|
C 513 Literal value requires a U suffix. : 3 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : if (mag[6] > mag[7]/3) return -1;
|
|||
|
|
|||
|
C 513 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : if (mag[6] > mag[7]/3) return -1;
|
|||
|
|
|||
|
C 513 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (mag[6] > mag[7]/3) return -1;
|
|||
|
|
|||
|
C 514 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
510
|
|||
|
Source : int detect_out_of_phase(uint16_t *mag) {
|
|||
|
Source : if (mag[-1] > mag[1]/3) return -1;
|
|||
|
|
|||
|
C 514 Array index is negative. : mag[*]; accessed=-1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
Source : if (mag[-1] > mag[1]/3) return -1;
|
|||
|
|
|||
|
C 514 Literal value requires a U suffix. : 3 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : if (mag[-1] > mag[1]/3) return -1;
|
|||
|
|
|||
|
C 514 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : if (mag[-1] > mag[1]/3) return -1;
|
|||
|
|
|||
|
C 514 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (mag[-1] > mag[1]/3) return -1;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 39
|
|||
|
Maximum loop depth: 0
|
|||
|
Cyclomatic Complexity: 5
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 1
|
|||
|
Number of procedures which this calls: 0
|
|||
|
Number of comments associated with procedure: 6
|
|||
|
Number of comments in procedure header: 6
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
1 mag *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
****************************
|
|||
|
* *
|
|||
|
* apply_phase_correction *
|
|||
|
* (544 to 557 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
****************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : apply_phase_correction
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
C 548 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : for (j = 0; j < (MODE_S_LONG_MSG_BITS-1)*2; j += 2) {
|
|||
|
|
|||
|
C 548 For loop incrementation is not simple. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
Source : for (j = 0; j < (MODE_S_LONG_MSG_BITS-1)*2; j += 2) {
|
|||
|
|
|||
|
C 549 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
544
|
|||
|
Source : void apply_phase_correction(uint16_t *mag) {
|
|||
|
Source : if (mag[j] > mag[j+1]) {
|
|||
|
|
|||
|
C 551 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
544
|
|||
|
Source : void apply_phase_correction(uint16_t *mag) {
|
|||
|
Source : mag[j+2] = (mag[j+2] * 5) / 4;
|
|||
|
|
|||
|
C 551 Literal value requires a U suffix. : 5 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : mag[j+2] = (mag[j+2] * 5) / 4;
|
|||
|
|
|||
|
C 551 Literal value requires a U suffix. : 4 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : mag[j+2] = (mag[j+2] * 5) / 4;
|
|||
|
|
|||
|
C 554 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
544
|
|||
|
Source : void apply_phase_correction(uint16_t *mag) {
|
|||
|
Source : mag[j+2] = (mag[j+2] * 4) / 5;
|
|||
|
|
|||
|
C 554 Literal value requires a U suffix. : 4 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : mag[j+2] = (mag[j+2] * 4) / 5;
|
|||
|
|
|||
|
C 554 Literal value requires a U suffix. : 5 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : mag[j+2] = (mag[j+2] * 4) / 5;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 26
|
|||
|
Maximum loop depth: 1
|
|||
|
Cyclomatic Complexity: 3
|
|||
|
Essential Cyclomatic Complexity: 1
|
|||
|
Number of procedures which call this one: 1
|
|||
|
Number of procedures which this calls: 0
|
|||
|
Number of comments associated with procedure: 29
|
|||
|
Number of comments in procedure header: 26
|
|||
|
Number of comments in declarations: 0
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
1 mag * *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
***************************
|
|||
|
* *
|
|||
|
* mode_s_detect *
|
|||
|
* (562 to 740 mode-s.c) *
|
|||
|
* FAIL *
|
|||
|
* *
|
|||
|
***************************
|
|||
|
|
|||
|
Standards Violation Summary
|
|||
|
---------------------------
|
|||
|
=================================================================
|
|||
|
CODE VIOLATION STANDARD
|
|||
|
=================================================================
|
|||
|
C No prototype for non-static function. : mode_s_detect
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.8.4
|
|||
|
C DD data flow anomalies found. MISRA-C:2012(Ed 3 Rev 1) R.2.2
|
|||
|
|
|||
|
|
|||
|
===========================================================================
|
|||
|
CODE LINE VIOLATION STANDARD
|
|||
|
===========================================================================
|
|||
|
M 728 Function call with no prior declaration. : cb MISRA-C:2012(Ed 3 Rev 1) R.17.3
|
|||
|
Source : cb(self, &mm);
|
|||
|
|
|||
|
C 591 Literal value requires a U suffix. : 0 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : for (j = 0; j < maglen - MODE_S_FULL_LEN*2; j++) {
|
|||
|
|
|||
|
C 591 Signed/unsigned conversion without cast. : (unsigned int and int): j
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : for (j = 0; j < maglen - MODE_S_FULL_LEN*2; j++) {
|
|||
|
|
|||
|
C 591 Literal value requires a U suffix. : 8 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : for (j = 0; j < maglen - MODE_S_FULL_LEN*2; j++) {
|
|||
|
|
|||
|
C 591 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : for (j = 0; j < maglen - MODE_S_FULL_LEN*2; j++) {
|
|||
|
|
|||
|
C 591 Value is not of appropriate type. : (unsigned int and signed char): j < maglen - ( 8 +
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : for (j = 0; j < maglen - MODE_S_FULL_LEN*2; j++) {
|
|||
|
|
|||
|
C 591 Use of mixed mode arithmetic. : (unsigned int and signed char): j < maglen - ( 8 + 112
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : for (j = 0; j < maglen - MODE_S_FULL_LEN*2; j++) {
|
|||
|
|
|||
|
C 595 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (use_correction) goto good_preamble; // We already checked it.
|
|||
|
|
|||
|
C 600 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : if (!(mag[j] > mag[j+1] &&
|
|||
|
|
|||
|
C 600 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (!(mag[j] > mag[j+1] &&
|
|||
|
|
|||
|
C 601 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+1] < mag[j+2] &&
|
|||
|
|
|||
|
C 601 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : mag[j+1] < mag[j+2] &&
|
|||
|
|
|||
|
C 602 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+2] > mag[j+3] &&
|
|||
|
|
|||
|
C 602 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : mag[j+2] > mag[j+3] &&
|
|||
|
|
|||
|
C 603 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+3] < mag[j] &&
|
|||
|
|
|||
|
C 603 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : mag[j+3] < mag[j] &&
|
|||
|
|
|||
|
C 604 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+4] < mag[j] &&
|
|||
|
|
|||
|
C 604 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : mag[j+4] < mag[j] &&
|
|||
|
|
|||
|
C 605 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+5] < mag[j] &&
|
|||
|
|
|||
|
C 605 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : mag[j+5] < mag[j] &&
|
|||
|
|
|||
|
C 606 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+6] < mag[j] &&
|
|||
|
|
|||
|
C 606 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : mag[j+6] < mag[j] &&
|
|||
|
|
|||
|
C 607 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+7] > mag[j+8] &&
|
|||
|
|
|||
|
C 607 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : mag[j+7] > mag[j+8] &&
|
|||
|
|
|||
|
C 608 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+8] < mag[j+9] &&
|
|||
|
|
|||
|
C 608 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : mag[j+8] < mag[j+9] &&
|
|||
|
|
|||
|
C 609 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+9] > mag[j+6]))
|
|||
|
|
|||
|
C 609 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : mag[j+9] > mag[j+6]))
|
|||
|
|
|||
|
C 618 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : high = (mag[j]+mag[j+2]+mag[j+7]+mag[j+9])/6;
|
|||
|
|
|||
|
C 618 Signed/unsigned conversion without cast. : (int and unsigned short): high = ( mag [ j ] + mag [ j + 2 ] + mag [ j + 7 ] + mag [ j + 9 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : high = (mag[j]+mag[j+2]+mag[j+7]+mag[j+9])/6;
|
|||
|
|
|||
|
C 618 Literal value requires a U suffix. : 6 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : high = (mag[j]+mag[j+2]+mag[j+7]+mag[j+9])/6;
|
|||
|
|
|||
|
C 619 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : if (mag[j+4] >= high ||
|
|||
|
|
|||
|
C 620 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+5] >= high)
|
|||
|
|
|||
|
C 628 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : if (mag[j+11] >= high ||
|
|||
|
|
|||
|
C 629 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+12] >= high ||
|
|||
|
|
|||
|
C 630 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+13] >= high ||
|
|||
|
|
|||
|
C 631 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : mag[j+14] >= high)
|
|||
|
|
|||
|
C 640 (void) missing for discarded return value. MISRA-C:2012(Ed 3 Rev 1) R.17.7
|
|||
|
Source : memcpy(aux, mag+j+MODE_S_PREAMBLE_US*2, sizeof(aux));
|
|||
|
|
|||
|
C 640 Pointer arithmetic is not on array. MISRA-C:2012(Ed 3 Rev 1) R.18.1,R.18.4
|
|||
|
Source : memcpy(aux, mag+j+MODE_S_PREAMBLE_US*2, sizeof(aux));
|
|||
|
|
|||
|
C 640 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : memcpy(aux, mag+j+MODE_S_PREAMBLE_US*2, sizeof(aux));
|
|||
|
|
|||
|
M 640 Use of sizeof on an array parameter. MISRA-C:2012(Ed 3 Rev 1) R.12.5
|
|||
|
Source : memcpy(aux, mag+j+MODE_S_PREAMBLE_US*2, sizeof(aux));
|
|||
|
|
|||
|
C 641 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (j && detect_out_of_phase(mag+j)) {
|
|||
|
|
|||
|
C 641 Pointer arithmetic is not on array. MISRA-C:2012(Ed 3 Rev 1) R.18.1,R.18.4
|
|||
|
Source : if (j && detect_out_of_phase(mag+j)) {
|
|||
|
|
|||
|
C 641 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (j && detect_out_of_phase(mag+j)) {
|
|||
|
|
|||
|
C 642 Pointer arithmetic is not on array. MISRA-C:2012(Ed 3 Rev 1) R.18.1,R.18.4
|
|||
|
Source : apply_phase_correction(mag+j);
|
|||
|
|
|||
|
C 650 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : for (i = 0; i < MODE_S_LONG_MSG_BITS*2; i += 2) {
|
|||
|
|
|||
|
C 650 For loop incrementation is not simple. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
Source : for (i = 0; i < MODE_S_LONG_MSG_BITS*2; i += 2) {
|
|||
|
|
|||
|
C 651 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : low = mag[j+i+MODE_S_PREAMBLE_US*2];
|
|||
|
|
|||
|
C 651 Signed/unsigned conversion without cast. : (int and unsigned short): low = mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : low = mag[j+i+MODE_S_PREAMBLE_US*2];
|
|||
|
|
|||
|
C 651 Signed/unsigned conversion without cast. : (unsigned int and int): low = mag [ j + i
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : low = mag[j+i+MODE_S_PREAMBLE_US*2];
|
|||
|
|
|||
|
C 651 Use of mixed mode arithmetic. : (unsigned int and int): low = mag [ j + i
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : low = mag[j+i+MODE_S_PREAMBLE_US*2];
|
|||
|
|
|||
|
C 651 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : low = mag[j+i+MODE_S_PREAMBLE_US*2];
|
|||
|
|
|||
|
C 652 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : high = mag[j+i+MODE_S_PREAMBLE_US*2+1];
|
|||
|
|
|||
|
C 652 Signed/unsigned conversion without cast. : (int and unsigned short): high = mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : high = mag[j+i+MODE_S_PREAMBLE_US*2+1];
|
|||
|
|
|||
|
C 652 Signed/unsigned conversion without cast. : (unsigned int and int): high = mag [ j + i
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : high = mag[j+i+MODE_S_PREAMBLE_US*2+1];
|
|||
|
|
|||
|
C 652 Use of mixed mode arithmetic. : (unsigned int and int): high = mag [ j + i
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : high = mag[j+i+MODE_S_PREAMBLE_US*2+1];
|
|||
|
|
|||
|
C 652 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : high = mag[j+i+MODE_S_PREAMBLE_US*2+1];
|
|||
|
|
|||
|
C 654 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (delta < 0) delta = -delta;
|
|||
|
|
|||
|
C 657 Array index is negative. : bits[*]; accessed=-1
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
Source : bits[i/2] = bits[i/2-1];
|
|||
|
|
|||
|
C 657 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : bits[i/2] = bits[i/2-1];
|
|||
|
|
|||
|
C 663 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : if (i < MODE_S_SHORT_MSG_BITS*2) errors++;
|
|||
|
|
|||
|
C 663 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (i < MODE_S_SHORT_MSG_BITS*2) errors++;
|
|||
|
|
|||
|
C 668 Literal value requires a U suffix. : 0 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : bits[i/2] = 0;
|
|||
|
|
|||
|
C 668 Signed/unsigned conversion without cast. : (unsigned char and int): 2 ]
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : bits[i/2] = 0;
|
|||
|
|
|||
|
C 673 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (use_correction)
|
|||
|
|
|||
|
C 674 (void) missing for discarded return value. MISRA-C:2012(Ed 3 Rev 1) R.17.7
|
|||
|
Source : memcpy(mag+j+MODE_S_PREAMBLE_US*2, aux, sizeof(aux));
|
|||
|
|
|||
|
C 674 Pointer arithmetic is not on array. MISRA-C:2012(Ed 3 Rev 1) R.18.1,R.18.4
|
|||
|
Source : memcpy(mag+j+MODE_S_PREAMBLE_US*2, aux, sizeof(aux));
|
|||
|
|
|||
|
C 674 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : memcpy(mag+j+MODE_S_PREAMBLE_US*2, aux, sizeof(aux));
|
|||
|
|
|||
|
M 674 Use of sizeof on an array parameter. MISRA-C:2012(Ed 3 Rev 1) R.12.5
|
|||
|
Source : memcpy(mag+j+MODE_S_PREAMBLE_US*2, aux, sizeof(aux));
|
|||
|
|
|||
|
C 677 For loop incrementation is not simple. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
Source : for (i = 0; i < MODE_S_LONG_MSG_BITS; i += 8) {
|
|||
|
|
|||
|
C 678 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : msg[i/8] =
|
|||
|
|
|||
|
C 689 Signed/unsigned conversion without cast. : (int and unsigned char): msg
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : int msgtype = msg[0]>>3;
|
|||
|
|
|||
|
C 695 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : for (i = 0; i < msglen*8*2; i += 2) {
|
|||
|
|
|||
|
C 695 For loop incrementation is not simple. MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
Source : for (i = 0; i < msglen*8*2; i += 2) {
|
|||
|
|
|||
|
C 696 Declaration does not specify an array. : mag
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.18.1
|
|||
|
562
|
|||
|
Source : void mode_s_detect(mode_s_t *self, uint16_t *mag, uint32_t maglen, mode_s_callback_t cb) {
|
|||
|
Source : delta += abs(mag[j+i+MODE_S_PREAMBLE_US*2]-
|
|||
|
|
|||
|
C 696 Signed/unsigned conversion without cast. : (unsigned int and int): delta += abs ( mag [ j + i
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : delta += abs(mag[j+i+MODE_S_PREAMBLE_US*2]-
|
|||
|
|
|||
|
C 696 Use of mixed mode arithmetic. : (unsigned int and int): delta += abs ( mag [ j + i
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : delta += abs(mag[j+i+MODE_S_PREAMBLE_US*2]-
|
|||
|
|
|||
|
C 696 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : delta += abs(mag[j+i+MODE_S_PREAMBLE_US*2]-
|
|||
|
|
|||
|
C 696 Signed/unsigned conversion without cast. : (unsigned int and int): delta += abs ( mag [ j + i + 8 * 2 ] - mag [ j + i
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : delta += abs(mag[j+i+MODE_S_PREAMBLE_US*2]-
|
|||
|
|
|||
|
C 696 Use of mixed mode arithmetic. : (unsigned int and int): delta += abs ( mag [ j + i + 8 * 2 ] - mag [ j + i
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.2,R.10.3,R.10.4
|
|||
|
Source : delta += abs(mag[j+i+MODE_S_PREAMBLE_US*2]-
|
|||
|
|
|||
|
C 704 Expression needs brackets. MISRA-C:2012(Ed 3 Rev 1) R.12.1,R.20.7
|
|||
|
Source : if (delta < 10*255) {
|
|||
|
|
|||
|
C 712 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (errors == 0 || (self->aggressive && errors < 3)) {
|
|||
|
|
|||
|
C 719 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (mm.crcok) {
|
|||
|
|
|||
|
C 720 Literal value requires a U suffix. : 8 MISRA-C:2012(Ed 3 Rev 1) R.7.2,R.10.3,R.10.4
|
|||
|
Source : j += (MODE_S_PREAMBLE_US+(msglen*8))*2;
|
|||
|
|
|||
|
C 720 Value is not of appropriate type. : (unsigned int and signed char): j += ( 8 +
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.10.3,R.10.4,R.10.5,R.11.1
|
|||
|
Source : j += (MODE_S_PREAMBLE_US+(msglen*8))*2;
|
|||
|
|
|||
|
C 720 Implicit conversion of underlying type (MR). : (signed char and int): j += ( 8 + (
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : j += (MODE_S_PREAMBLE_US+(msglen*8))*2;
|
|||
|
|
|||
|
C 720 Narrower int conversion without cast. : (signed char and int): j += ( 8 + (
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3
|
|||
|
Source : j += (MODE_S_PREAMBLE_US+(msglen*8))*2;
|
|||
|
|
|||
|
C 720 Signed/unsigned conversion without cast. : (unsigned int and int): j += ( 8 + ( msglen * 8 )
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.10.3,R.10.4
|
|||
|
Source : j += (MODE_S_PREAMBLE_US+(msglen*8))*2;
|
|||
|
|
|||
|
C 722 No brackets to then/else. MISRA-C:2012(Ed 3 Rev 1) R.15.6
|
|||
|
Source : if (use_correction)
|
|||
|
|
|||
|
C 733 Expression is not Boolean. MISRA-C:2012(Ed 3 Rev 1) R.10.1,R.14.4
|
|||
|
Source : if (!good_message && !use_correction) {
|
|||
|
|
|||
|
C 595 Jump into nested block. MISRA-C:2012(Ed 3 Rev 1) R.15.3
|
|||
|
Source : if (use_correction) goto good_preamble; // We already checked it.
|
|||
|
|
|||
|
M 674 Copy source parameter not checked before use. : aux
|
|||
|
MISRA-C:2012(Ed 3 Rev 1) R.21.17
|
|||
|
Source : memcpy(mag+j+MODE_S_PREAMBLE_US*2, aux, sizeof(aux));
|
|||
|
|
|||
|
M 565 Procedure contains UR data flow anomalies. : aux MISRA-C:2012(Ed 3 Rev 1) R.9.1
|
|||
|
674
|
|||
|
Source : memcpy(mag+j+MODE_S_PREAMBLE_US*2, aux, sizeof(aux));
|
|||
|
Source : uint16_t aux[MODE_S_LONG_MSG_BITS*2];
|
|||
|
|
|||
|
M 563 Procedure contains UR data flow anomalies. : bits MISRA-C:2012(Ed 3 Rev 1) R.9.1
|
|||
|
657
|
|||
|
Source : bits[i/2] = bits[i/2-1];
|
|||
|
Source : unsigned char bits[MODE_S_LONG_MSG_BITS];
|
|||
|
|
|||
|
M 564 Procedure contains UR data flow anomalies. : msg MISRA-C:2012(Ed 3 Rev 1) R.9.1
|
|||
|
716
|
|||
|
Source : mode_s_decode(self, &mm, msg);
|
|||
|
Source : unsigned char msg[MODE_S_LONG_MSG_BITS/2];
|
|||
|
|
|||
|
C 734 Modification of loop counter in loop body. : j MISRA-C:2012(Ed 3 Rev 1) R.14.2
|
|||
|
Source : j--;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Basic Information
|
|||
|
-----------------
|
|||
|
Number of executable reformatted lines: 255
|
|||
|
Maximum loop depth: 2
|
|||
|
Cyclomatic Complexity: 42
|
|||
|
Essential Cyclomatic Complexity: 6
|
|||
|
Number of procedures which call this one: 0
|
|||
|
Number of procedures which this calls: 7
|
|||
|
Number of comments associated with procedure: 60
|
|||
|
Number of comments in procedure header: 3
|
|||
|
Number of comments in declarations: 22
|
|||
|
The procedure is reducible
|
|||
|
|
|||
|
|
|||
|
Parameter Analysis
|
|||
|
------------------
|
|||
|
========================================================
|
|||
|
NUMBER NAME DEFINED REFERENCED CLEAR PATH
|
|||
|
========================================================
|
|||
|
4 cb *
|
|||
|
3 maglen *
|
|||
|
2 mag * * *
|
|||
|
1 (self)->icao_cache
|
|||
|
* * *
|
|||
|
1 (self)->fix_errors * *
|
|||
|
1 (self)->check_crc * *
|
|||
|
1 (self)->aggressive * *
|
|||
|
1 self * *
|
|||
|
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
******************
|
|||
|
* *
|
|||
|
* Key to Terms *
|
|||
|
* *
|
|||
|
******************
|
|||
|
|
|||
|
Standards violations for procedures are printed in tables with code markers as follows:
|
|||
|
---------------------------------------------------------------------------------------
|
|||
|
|
|||
|
====================================================================
|
|||
|
CODE (LINE) VIOLATION STANDARD
|
|||
|
====================================================================
|
|||
|
M (Source line number) [Text of Mandatory standard] [Appropriate rule reference]
|
|||
|
C [Text of Required standard]
|
|||
|
O [Text of Advisory standard]
|
|||
|
[Source: Text of line from Source file]
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Required standards are considered mandatory but individual instances may be overridden
|
|||
|
by adding annotations to the source code
|
|||
|
|
|||
|
Advisory standards provide additional quality criteria but may be violated
|
|||
|
|
|||
|
For some standards violations, additional information is provided in results tables
|
|||
|
Note that source lines do not show macro expansions
|
|||
|
|
|||
|
"Off" in Summary tables indicates that a standard is switched off
|
|||
|
in the <lang>pen.dat file
|
|||
|
"MR" in Summary tables indicates a MISRA Restricted standard
|
|||
|
which cannot be checked without the MISRA licence option.
|
|||
|
|
|||
|
|
|||
|
A summary is given of the pass/fail result of each program component as follows:
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
|
|||
|
Components which pass all standards are marked: Pass
|
|||
|
Components which fail only Advisory standards are marked: Conditional Pass
|
|||
|
Components which fail on insufficient comments only are marked:
|
|||
|
Comment FAIL
|
|||
|
Components which violate Mandatory standards are marked: FAIL
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
Procedure Results table breakdown (Example Only)
|
|||
|
------------------------------------------------
|
|||
|
|
|||
|
=======================================
|
|||
|
UNIQUE VIOLATIONS FAILURE DENSITY
|
|||
|
(VIOLS/R.LINE %)
|
|||
|
=======================================
|
|||
|
65 ####### 150 ###########
|
|||
|
35 #### 39 ####
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
The Violation density for a function is the number of violations per reformatted line, expressed as a percentage.
|
|||
|
It is an indication of code quality.
|
|||
|
|
|||
|
Functions with a high violation density are likely to be smaller functions with a large number of violations.
|
|||
|
|
|||
|
Lower density may indicate larger functions with fewer violations.
|
|||
|
|
|||
|
(nViols / nRefLines) x 100
|
|||
|
|
|||
|
where:
|
|||
|
|
|||
|
nViols = number of standard violations in a function.
|
|||
|
|
|||
|
and:
|
|||
|
|
|||
|
nRefLines = number of reformatted lines in a function.
|
|||
|
|
|||
|
The unique standards failure ratio is an indication of variety of standards violations in a module.
|
|||
|
|
|||
|
Thus a function containing one instance of several different standards will have a high ratio,
|
|||
|
while a function that has violated only one standard will have a low ratio.
|
|||
|
|
|||
|
|
|||
|
--------------------------------------------------------------------------------
|
|||
|
===========================================================
|
|||
|
* *
|
|||
|
* End of Code Review Report *
|
|||
|
* *
|
|||
|
* Copyright (C) 2019 Liverpool Data Research Associates *
|
|||
|
* *
|
|||
|
===========================================================
|
|||
|
|
|||
|
|