MISRA C:2012

MISRA C:2012

Tool

Version

PC-Lint

V9.00L

Violations

Total

Violations

Total

Required Directives

0

Required Rules

8

Advisory Directives

1

Advisory Rules

7

Directive

Type

Rationale

PC-Lint Results

Directive

Type

Rationale

PC-Lint Results

1.1

Required

 

:check_mark:

2.1

Required

 

:check_mark:

3.1

Required

 

:check_mark:

4.1

Required

 

:check_mark:

4.2

Advisory

 

:check_mark:

4.3

Required

 

:check_mark:

4.4

Advisory

 

:check_mark:

4.5

Advisory

 

:check_mark:

4.6

Advisory

 

:check_mark:

4.7

Required

 

:check_mark:

4.8

Advisory

 

:check_mark:

4.9

Advisory

  1. Function-like macros are used instead of functions for several reasons in uC/OS-III. They improve code clarity without increasing overhead for bitwise operations. Additionally, operations such as disabling interrupts and context switching can be optimized by the port developer since they need not incur the overhead of a function call. This style of macro also provides a clean way to add hooks for external instrumentation.

:cross_mark:

4.10

Required

 

:check_mark:

4.11

Required

 

:check_mark:

4.12

Required

 

:check_mark:

4.13

Advisory

 

:check_mark:

Rule

Type

Rationale

PC-Lint Results

Rule

Type

Rationale

PC-Lint Results

1.1

Required

 

:check_mark:

1.2

Advisory

 

:check_mark:

1.3

Required

 

:check_mark:

2.1

Required

  1. The DEF_BIT_IS_SET(val, mask) and DEF_BIT_IS_CLR(val, mask) macros check to see if mask is 0 in order to return the proper value. Since mask is often a #define constant in the context of uC/OS-III, the expression is a constant value boolean.

  2. DEF_BIT_FIELD(bit_field, bit_shift) is used to calculate the threshold value for detecting if a delay has completed before the task was added to the tick list. The threshold value, OS_TICK_TH_RDY, is purely a function of the size of the OS_TICK datatype and is evaluated at compile-time. The boolean expression in DEF_BIT_FIELD(bit_field, bit_shift) will therefore be a constant-value boolean.

:cross_mark:

2.2

Required

 

:check_mark:

2.3

Advisory

  1. All kernel types are defined regardless of the kernel features which are enabled. Some types will be unused in certain kernel configurations or are unused but remain in the code for legacy reasons.

:cross_mark:

2.4

Advisory

  1. The uC/OS-III coding standard requires that all structs have a tag as well as a  type name. However, only the type names may be used in the code. Therefore,  the struct tags remain unused outside of typedefs.

:cross_mark:

2.5

Advisory

  1. Certain macros are defined for application use, debugging use, or as required by the coding standards. Others are present for backwards-compatibility with older software. These macros may not be referenced by the kernel code in some or all circumstances.

:cross_mark:

2.6

Advisory

 

:check_mark: