MISRA C 2004 Compliance Deviations
Introduction
This document contains MISRA C 2004 Compliance exceptions and documented features for Processor Expert generated code.
The document contains chapter for each supported microcontroller architecture.
Each chapter contains:
- documentation required or recommended by MISRA standard;
- general exceptions, which apply across all embedded components;
- component exceptions associated with certain embedded component;
- PC-Lint configuration used for MISRA validation.
The MISRA compliance was checked using PC-Lint tool, so it is possible to find exceptions as a comment also in the generated code.
HCS12,HCS12X,HCS12Z Derivatives
Required documentation for HCS12,HCS12X,HCS12Z Derivatives
Rule |
Type |
Rule Description |
Documentation |
3.1 |
Required |
All usage of implementation-defined behavior shall be documented. |
- Follows the list of implementation dependent behavior used in Processor Expert. See documentation of CodeWarrior S12(X) Build tools for more information on topics not specified below:
- Startup function of the application is 'void _EntryPoint(void)' function, see Reset Scenario. HCS12(X) derivatives have two additional reset vectors: If clock monitor is enabled and clock monitor reset occurred, 'void _ClockMonitor_EntryPoint(void)' function is startup function of the application. 'void _COP_EntryPoint(void)' is startup function of the application if COP is enabled and COP reset occurred.
- Program is finished at the end of main function in the infinite loop.
- Execution character set and corresponding values are documented in rule 3.2 in this table.
- Identifiers of registers sometimes have more than 31 characters to comply with the reference manual of the derivative. The number of significant initial characters in an identifier for CodeWarrior S12(X) compiler is 32,767 according to documentation of CodeWarrior S12(X) Build tools.
- 'Plain' char type (char_t) is unsigned by default setting of the compiler. The type is used in BWimage, COLimage, StringList and Term components.
- Signed integers are used in BWimage, COLimage, Term and PWMMC components. Signed integers are in two’s complement representation. Conversion between signed and unsigned integer is used in PWMMC and Term components. For more information see the documentation of CodeWarrior S12(X) Build tools.
- Float type is used in FreeCntr8, FreeCntr16, FreeCntr32, Term, PPG, PWM, TimerInt and TimerOut components. The Compiler supports two IEEE floating point formats: IEEE32 and IEEE64. For more information see the documentation of CodeWarrior S12(X) Build tools.
- Conversion of pointer type to integer type is used in IntFlash, IntEEPROM components. The integer type contains 3 byte number corresponding to the pointer address. Conversion of integer type to pointer type is used in IntFlash, IntEEPROM, CPU, ExtBitIO, ExtByteIO, Ext16IO, Ext32IO, Ext8IO. The pointer points to an address represented by the integer number (far keyword is used if integer number represents global address).
- Unsigned char bit-field type is used. For more information on bit-fields see documented rule 3.5 in this table or the documentation of CodeWarrior S12(X) Build tools.
- Volatile qualified variables are used to access peripheral registers (memory mapped).
- #include "HeaderName" directive is used to include header files generated to the project. #include <HeaderName> directive is used to include CodeWarrior library header files. Nesting levels for #include files is 512. For more information see the documentation of CodeWarrior S12(X) Build tools.
- Pragma directives are used and commented in the source code. See also documented rule 3.4 in this table.
- Following CodeWarrior library header files are used: hidef.h (Device Initialization), limits.h (TimeDate component), stddef.h (ADC component)
- Inline keyword is used in AsynchroSerial, AsynchroMaster and AsynchroSlave component. All calls of inline function are replaced by the code of this function, if possible. For more information see the documentation of CodeWarrior S12(X) Build tools.
|
3.2 |
Required |
The character set and the corresponding encoding shall be documented. |
Basic character set (see ISO 9899) is used in execution character set. Execution character set uses ASCII encoding (possible codes 0-255). Exception to basic character set: Term component uses NULL(0x00), CR (0x0D), LF(0x0A). |
3.3 |
Advisory |
The implementation of integer division in the chosen compiler should be determined, documented and taken into account. |
The way a Compiler implements division and modulo for negative operands is determined by the hardware implementation of the target’s division instructions. See documentation of CodeWarrior S12(X) Build tools for more information. |
3.4 |
Required |
All uses of the #pragma directives shall be documented and explained. |
- All components use pragma directive to determine the memory segment, where code and data will be used (see below). All other uses of #pragma directives are commented in the generated source code.
- #pragma CODE_SEG __NEAR_SEG NON_BANKED - places the code into non-banked memory area.
- #pragma CODE_SEG [SegmentName] - where [SegmentName] is identifier of the memory segment. Places the code into specified memory area. For all PE components this directive selects DEFAULT memory area.
- #pragma DATA_SEG [SegmentName] - where [SegmentName] is identifier of the memory segment. Places the data into specified memory area. For all PE components this directive selects DEFAULT memory area.
|
3.5 |
Required |
The implementation-defined behavior and packing of bit fields shall be documented if being relied upon. |
- Bits in byte bit-fields are allocated from the least significant bit to the most significant bit in the order of declaration.
- The bit-field allocation tries to avoid crossing a byte boundary whenever possible. To achieve optimized accesses, the compiler may insert some padding or gap bits to reach this. Maximum number of gap bits is set to 1 by default. Exception is register header files (IO_Map.h) where maximum number of gap bits is unlimited (4294967295).
- See documentation of CodeWarrior S12(X) Build tools for more information.
|
3.6 |
Required |
All libraries used in production code shall be written to comply with the provision of this document and shall have been subject to appropriate validation. |
Only libraries included in CodeWarrior development studio are used in the generated source code. |
General Exceptions for HCS12,HCS12X,HCS12Z Derivatives
Rule |
Type |
Rule Description |
Reason |
1.1 |
Required |
All code shall conform to ISO 9899-1990 (C-code guideline) |
All components may contain one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
2.4 |
Advisory |
Sections of code should not be 'commented out'. |
Each init component contains 'Commented out' example of interrupt service routine (ISR), if generation of the ISR is enabled. |
12.10 |
Required |
The comma operator shall not be used. |
Comma operator is used in macros for simple methods (optimization for code size). The rule is globally disabled for 'Generate macros = yes' option (Build Options) |
14.7 |
Required |
A function shall have a single point of exit at the end of the function. |
Use of multiple return statements simplifies the code logic. |
19.7 |
Advisory |
A function should be used in preference to a function-like macro. |
Macros are used to optimize simple methods for code size. The rule is globally disabled for 'Generate macros = yes' option (Build Options). |
19.15 |
Required |
Precautions shall be taken in order to prevent the contents of a header file being included twice. |
All generated header files contain associated macro, which definition is tested. The headers file's content is included only if the macro is not defined. |
Component Exceptions for HCS12,HCS12X,HCS12Z Derivatives
Component |
Rule |
Type |
Rule Details |
Reason |
PE_Types.h |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
PE_Types.h |
14.3 |
Required |
Description: A null statement shall only occur on a line by itself
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 14.3, null statement not in line by itself
|
Several inline asm instructions are in one line separated by semicolon (asm() is ignored by PC-lint). |
PE_Types.h |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
PE_Types.h |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macro: All macros for register access, __DI, __EI, EnterCritical, ExitCritical, SaveStatusReg, RestoreStatusReg, PE_DEBUGHALT, ISR |
PE_Types.h |
19.12 |
Required |
Description: There shall be at most one occurrence of the # or ## preprocessor operators in a single macro definition.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 19.12, Multiple use of '#/##' operators in macro definition
|
Multiple occurrences of preprocessor operators are used to convert bit name to bit mask in macros for accessing peripheral registers. |
PE_Types.h |
19.13 |
Advisory |
Description: The # and ## preprocessor operators should not be used.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.13, '#/##' operator used
|
Used to convert bit name to bit mask in macros accessing registers. |
IO_Map.h |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
IO_Map.h |
5.1 |
Required |
Description: Identifiers (internal and external) shall not rely on the significance of more than 31 characters.
PC-Lint message: Warning 621: Identifier clash [MISRA 2004 Rules 1.2, 1.4 and 5.1]
|
Length of register identifiers of peripheral modules are sometimes longer than 31 characters to comply with the Reference Manual. |
IO_Map.h |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
IO_Map.h |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
IO_Map.h |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macro: __RESET_WATCHDOG |
Vectors.c |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
Cpu |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
Cpu |
8.10 |
Required |
Description: All declarations and definitions of objects or function at file scope shall have internal linkage unless external linkage is required.
PC-Lint message: Info 765: external 'function' could be made static [MISRA 2004 Rule 8.10]
|
Device Initialization - ISR declaration is subject of various modifications by the user and may or may not be copied to another module - static is not used. |
Cpu |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
INITRG register is written by typecasting address value to pointer; When Interrupt vector table is generated into RAM, pointers to ISR functions are initialized by typecast of an integral value to the function pointer type. Typecast from pointer to integral type is also used in SetIntVect method when checking parameter value; ExtBitIO Port array initialization structure uses integer value casted to pointer for definition of pointer to external memory; In SetIntVect method, interrupt vector allocation is checked by using typecast of a pointer to address value (integer). Only if interrupt vector table in RAM is selected. |
Cpu |
14.2 |
Required |
Description: All non-null statements shall either: a) have at least one side effect however executed, or b) cause control flow to change.
PC-Lint message: Warning 522: Highest operation, function 'string', lacks side-effects [MISRA 2004 Rule 14.2]
|
PC-lint reports the warning for 'Delay100US' method, which is a wrapper for inline asm block (asm block is ignored by PC-lint). |
Cpu |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: GetPllLockStatusFlag, GetLowVoltageFlag, SetStopMode, SetWaitMode, DisableInt, EnableInt, GetSpeedMode |
Cpu |
19.13 |
Advisory |
Description: The # and ## preprocessor operators should not be used.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.13, '#/##' operator used
|
Not a preprocessor directive, used in high level inline asm command. |
PPG |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
PPG |
14.2 |
Required |
Description: All non-null statements shall either: a) have at least one side effect however executed, or b) cause control flow to change.
PC-Lint message: Warning 522: Highest operation, function 'string', lacks side-effects [MISRA 2004 Rule 14.2]
|
PC-lint reports the warning for 'SetRatio' function, which is a wrapper for inline asm block (asm block is ignored by PC-lint). |
PWM |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
PWM |
14.2 |
Required |
Description: All non-null statements shall either: a) have at least one side effect however executed, or b) cause control flow to change.
PC-Lint message: Warning 522: Highest operation, function 'string', lacks side-effects [MISRA 2004 Rule 14.2]
|
PC-lint reports the warning for 'SetRatio' function, which is a wrapper for inline asm block (asm block is ignored by PC-lint). |
IntFlash |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
IntFlash |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Info 740: Unusual pointer cast (incompatible indirect types) [MISRA 2004 Rule 1.2]
|
When writing to FLASH memory, the routine waiting for write operation completion is copied to RAM memory and run in the RAM memory. Pointer cast of the wait routine is used for copy of the routine to the RAM memory. |
IntFlash |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
Driver writing to FLASH memory uses pointer type for accessing data in the memory and integer type for manipulation and storage of the address to memory. Conversion between both types is needed and performed by the typecast between integral type and pointer type. |
IntFlash |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
The FLASH peripheral module works with two data bytes (word) for write operation, but access to one byte is needed (GetByte, SetByte methods). Conversion between the pointer to byte and pointer to word is used and typecast for pointer arithmetic is used. |
IntFlash |
16.7 |
Advisory |
Description: A pointer parameter in a function prototype should be declared as pointer to const if the pointer is not used to modify the addressed object.
PC-Lint message: Info 818: Pointer parameter could be declared as pointing to const [MISRA 2004 Rule 16.7]
|
'Source' parameter of SetBlockFlash method can be declared as const but only in specific component's setting (Write method = Write or Safe write). User interface should be uniform for all settings of the component, that's why 'const' is not used. |
IntFlash |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for read/write a block of data from/to Flash memory (GetBlockFlash, WriteArray, SetPage in 'safe write' mode). Address parameter is converted to a pointer and by adding an offset to the pointer, data is accessed. |
IntFlash |
17.4 |
Required |
Description: Array indexing shall be the only allowed form of pointer arithmetic.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for read/write a block of data from/to Flash memory. Address parameter is converted to a pointer and data is accessed by adding an offset to the pointer. |
IntFlash |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods and macros: EraseVerify, SetProtection, EraseFlash, SetWait, Busy, AddrOutOfRange, BlockOutOfRange, BlockAddress, GlobalToLocal, ClearFlags |
IntEEPROM |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
IntEEPROM |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
Driver writing to EEPROM memory uses pointer type for accessing data in the memory and integral type for manipulation and storage of the address to memory. Conversion between both types is needed and performed by the typecast between integral type and pointer type. |
IntEEPROM |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
The EEPROM peripheral module works with two data bytes (word) for write operation, but access to one byte is needed (GetByte, SetByte methods). Conversion between the pointer to byte and pointer to word is used and typecast for pointer arithmetic is used. |
IntEEPROM |
16.7 |
Advisory |
Description: A pointer parameter in a function prototype should be declared as pointer to const if the pointer is not used to modify the addressed object.
PC-Lint message: Info 818: Pointer parameter could be declared as pointing to const [MISRA 2004 Rule 16.7]
|
'Addr' parameter of EraseEeprom method can be declared as const but only in specific component's setting. User interface should be uniform for all settings of the component, that's why 'const' is not used. |
IntEEPROM |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for read/write a block of data from/to Flash memory. Address parameter is converted to a pointer and by adding an offset to the pointer, data is accessed. |
IntEEPROM |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
IntEEPROM |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: SetWait, Busy, |
WatchDog |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
ExtInt |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
ExtInt |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: Enable, Disable, GetVal |
ExtInt |
19.13 |
Advisory |
Description: The # and ## preprocessor operators should not be used.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.13, '#/##' operator used
|
Not a preprocessor directive, used in high level inline asm command. |
Byteflight |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
Byteflight |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
Byteflight |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for read/write data from/to peripheral registers in ReadFrame and SendFrame methods. Register address, which corresponds to the start of the message buffer, is incremented when reading/writing the message. Range of the address is incremented only up to the length of the message (is part of the received frame). |
Byteflight |
17.4 |
Required |
Description: Array indexing shall be the only allowed form of pointer arithmetic.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for read/write data from/to peripheral registers in ReadFrame and SendFrame methods. Register address, which corresponds to the start of the message buffer, is incremented when reading/writing the message. Range of the address is incremented only up to the length of the message (is part of the received frame). |
Byteflight |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
Byteflight |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: SetAlarm, ClrAlarm, SetSleepRequest, ClrSleepRequest, GetSleepAck, GetInitAck, GetModuleVersion |
SW_I2C |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
SW_I2C |
14.2 |
Required |
Description: All non-null statements shall either: a) have at least one side effect however executed, or b) cause control flow to change.
PC-Lint message: Warning 522: Highest operation, function 'string', lacks side-effects [MISRA 2004 Rule 14.2]
|
PC-lint reports the warning for 'Delay' function, which is a wrapper for inline asm block (asm block is ignored by PC-lint). |
SW_I2C |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for user buffer access. The buffer is allocated by the user and handed over in a method parameter for SendBlock and RecvBlock methods. Additional parameter specifies length of the buffer - pointer is manipulated only in the range between 0 and length of the buffer. |
SW_I2C |
17.4 |
Required |
Description: Array indexing shall be the only allowed form of pointer arithmetic.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
User buffer is used to store data send/received to/from communication bus. Pointer arithmetic is used for manipulation with this buffer. |
Init_IRQ |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
TimerInt |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
Ext16IO |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
Ext16IO |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
Driver is writing to External address space using typecast of address value (integer) to a pointer. |
Ext8IO |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
Ext8IO |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
Driver is writing to External address space using typecast of address value (integer) to a pointer. |
Ext32IO |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
Ext32IO |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
Driver is writing to External address space using typecast of address value (integer) to a pointer. |
ExtBitIO |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
ExtBitIO |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
Driver is writing to External address space using typecast of address value (integer) to a pointer. |
ExtBitIO |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: GetVal, PutVal, SetDir, GetDir, ClrVal, SetVal, NegVal |
ExtByteIO |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
ExtByteIO |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
Driver is writing to External address space using typecast of address value (integer) to a pointer. |
ADC |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, far, interrupt, __interrupt. |
ADC |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
ADC |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
In Init method, CSL and RVL allocation is set to pointer registers by using typecast of a pointer to address value (integer). |
ADC |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Typecast between pointers is used in GetChanValue, GetChanValue8 and GetChanValue16 methods when 'Autoscan = yes' and 'Number of conversions = 1' is selected. Register address, which corresponds to the beginning of the result registers array, is used for result retrieving after typecast. |
ADC |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for user buffer access. The buffer is allocated by the user and handed over in a method parameter. Related to GetValue, GetValue8 and GetValue16 methods. |
ADC |
17.4 |
Required |
Description: Array indexing shall be the only allowed form of pointer arithmetic.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for manipulation with user data buffer when reading measured values by GetValue, GetValue8 and GetValue16 methods. |
ADC |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
ADC |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macros: MeasureWait, MeasureNotWait, MeasureChanWait, MeasureChanNotWait |
Byte2IO |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Note 931: Both sides have side effects [MISRA 2004 Rule 1.2]
|
PC-Lint reports for reading the input value by GetVal method from several ports. The variable in header file for access to each port register is declared as volatile, but the order of register access is not important (neglected) for IO access. |
Byte3IO |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Note 931: Both sides have side effects [MISRA 2004 Rule 1.2]
|
PC-Lint reports for reading the input value by GetVal method from several ports. The variable in header file for access to each port register is declared as volatile, but the order of register access is not important (neglected) for IO access. |
Byte4IO |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Note 931: Both sides have side effects [MISRA 2004 Rule 1.2]
|
PC-Lint reports for reading the input value by GetVal method from several ports. The variable in header file for access to each port register is declared as volatile, but the order of register access is not important (neglected) for IO access. |
Capture |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: %[5,Doc_Misra_Rule_2_Location_Lint]
|
%[5,Doc_Misra_Rule_2_Location_Reason] |
Capture |
5.1 |
Required |
Description: Identifiers (internal and external) shall not rely on the significance of more than 31 characters.
PC-Lint message: Warning 621: Identifier clash [MISRA 2004 Rules 1.2, 1.4 and 5.1]
|
Length of register identifiers of peripheral modules are sometimes longer than 31 characters to comply with the Reference Manual. |
Capture |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Typecast between pointers is used in GetCaptureValue method in case, it is generated as a macro. |
FreeCntr |
5.1 |
Required |
Description: Identifiers (internal and external) shall not rely on the significance of more than 31 characters.
PC-Lint message: Warning 621: Identifier clash [MISRA 2004 Rules 1.2, 1.4 and 5.1]
|
Component instance name is given by user and it is part of Free Counter constant names. |
FreeCntr |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Typecast between pointers is used in GetCounterValue in case this method is generated as a macro. |
AsynchroSerial |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
AsynchroSerial |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for user buffer access in SendBlock and RecvBlock methods. The buffer is allocated by the user and handed over in a method parameter. Additional parameter specifies length of the buffer - pointer is manipulated only in the range between 0 and length of the buffer. |
AsynchroSerial |
17.2 |
Required |
Description: Pointer subtraction shall only be applied to pointers that address elements of the same array.
PC-Lint message: Note 946: Relational or subtract operator applied to pointers [MISRA 2004 Rules 17.2 and 17.3]
|
Internal circular buffer is used to store data send/received to/from communication bus (If input or output data buffer is enabled). Pointer subtraction is used to check if read/write pointer is not out of circular buffer range. |
AsynchroSerial |
17.4 |
Required |
Description: Array indexing shall be the only allowed form of pointer arithmetic.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Internal circular buffer is used to store data send/received to/from communication bus (If input or output data buffer is enabled). Pointer arithmetic is used for manipulation with this buffer. |
AsynchroSerial |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
AsynchroSerial |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: Standby, LoopMode, SetDirection, TurnRxOff, TurnRxOn, TurnTxOff, TurnTxOn, GetTxComplete |
AsynchroMaster |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
AsynchroMaster |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for user buffer access in SendBlock and RecvBlock methods. The buffer is allocated by the user and handed over in a method parameter. Additional parameter specifies length of the buffer - pointer is manipulated only in the range between 0 and length of the buffer. |
AsynchroMaster |
17.2 |
Required |
Description: Pointer subtraction shall only be applied to pointers that address elements of the same array.
PC-Lint message: Note 946: Relational or subtract operator applied to pointers [MISRA 2004 Rules 17.2 and 17.3]
|
Internal circular buffer is used to store data send/received to/from communication bus (If input or output data buffer is enabled). Pointer subtraction is used to check if read/write pointer is not out of circular buffer range. |
AsynchroMaster |
17.4 |
Required |
Description: Array indexing shall be the only allowed form of pointer arithmetic.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Internal circular buffer is used to store data send/received to/from communication bus (If input or output data buffer is enabled). Pointer arithmetic is used for manipulation with this buffer. |
AsynchroMaster |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
AsynchroMaster |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: Standby, LoopMode, SetDirection, TurnRxOff, TurnRxOn, TurnTxOff, TurnTxOn, GetTxComplete |
AsynchroSlave |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
AsynchroSlave |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for user buffer access in SendBlock and RecvBlock methods. The buffer is allocated by the user and handed over in a method parameter. Additional parameter specifies length of the buffer - pointer is manipulated only in the range between 0 and length of the buffer. |
AsynchroSlave |
17.2 |
Required |
Description: Pointer subtraction shall only be applied to pointers that address elements of the same array.
PC-Lint message: Note 946: Relational or subtract operator applied to pointers [MISRA 2004 Rules 17.2 and 17.3]
|
Internal circular buffer is used to store data send/received to/from communication bus (If input or output data buffer is enabled). Pointer subtraction is used to check if read/write pointer is not out of circular buffer range. |
AsynchroSlave |
17.4 |
Required |
Description: Array indexing shall be the only allowed form of pointer arithmetic.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Internal circular buffer is used to store data send/received to/from communication bus (If input or output data buffer is enabled). Pointer arithmetic is used for manipulation with this buffer. |
AsynchroSlave |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
AsynchroSlave |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: Standby, LoopMode, SetDirection, TurnRxOff, TurnRxOn, TurnTxOff, TurnTxOn, GetTxComplete |
SynchroMaster |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
SynchroMaster |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for user buffer access in SendBlock and RecvBlock methods. The buffer is allocated by the user and handed over in a method parameter. Additional parameter specifies length of the buffer - pointer is manipulated only in the range between 0 and length of the buffer. |
SynchroMaster |
17.2 |
Required |
Description: Pointer subtraction shall only be applied to pointers that address elements of the same array.
PC-Lint message: Note 946: Relational or subtract operator applied to pointers [MISRA 2004 Rules 17.2 and 17.3]
|
Internal circular buffer is used to store data send/received to/from communication bus (If input or output data buffer is enabled). Pointer subtraction is used to check if read/write pointer is not out of circular buffer range. |
SynchroMaster |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
SynchroMaster |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: SetDir |
SynchroSlave |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
SynchroSlave |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for user buffer access in SendBlock and RecvBlock methods. The buffer is allocated by the user and handed over in a method parameter. Additional parameter specifies length of the buffer - pointer is manipulated only in the range between 0 and length of the buffer. |
SynchroSlave |
17.2 |
Required |
Description: Pointer subtraction shall only be applied to pointers that address elements of the same array.
PC-Lint message: Note 946: Relational or subtract operator applied to pointers [MISRA 2004 Rules 17.2 and 17.3]
|
Internal circular buffer is used to store data send/received to/from communication bus (If input or output data buffer is enabled). Pointer subtraction is used to check if read/write pointer is not out of circular buffer range. |
SynchroSlave |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
SynchroSlave |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: SetDir |
BDLC |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
BDLC |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for user buffer access. The buffer is allocated by the user and handed over in a method parameter for RecvBlock, RecvIFR and SendBlock methods. Additional parameter specifies length of the buffer - pointer is manipulated only in the range between 0 and length of the buffer. |
BDLC |
17.2 |
Required |
Description: Pointer subtraction shall only be applied to pointers that address elements of the same array.
PC-Lint message: Note 946: Relational or subtract operator applied to pointers [MISRA 2004 Rules 17.2 and 17.3]
|
Internal circular buffer is used to store data received from communication bus (If input data or IFR buffer is enabled). Pointer subtraction is used to check if read/write pointer is not out of circular buffer range. |
BDLC |
17.4 |
Required |
Description: Array indexing shall be the only allowed form of pointer arithmetic.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Internal circular buffer is used to store data send/received to/from communication bus (If input or IFR data buffer is enabled). Pointer arithmetic is used for manipulation with this buffer. |
BDLC |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
FreescaleCAN |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
FreescaleCAN |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Typecast between pointers is used for swapping order of bytes in a 32-bit variable for code size optimization (GetAcceptanceCode, SetAcceptanceCode, GetAcceptanceMask, SetAcceptanceMask, SendFrame, SendFrameExt, ReadFrame methods). Typecast between pointers is used to access parts of the message buffer. The message buffer is mapped to a structure type with defined sub-parts of the message (SendFrame, SendFrameExt and ReadFrame methods). |
FreescaleCAN |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for read data from peripheral registers in ReadFrame method. Register address, which corresponds to the start of the message buffer, is incremented when reading the message. Range of the address is incremented only up to the length of the message (is part of the received frame). |
FreescaleCAN |
17.4 |
Required |
Description: Array indexing shall be the only allowed form of pointer arithmetic.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for read data from peripheral registers in ReadFrame method. Register address, which corresponds to the start of the message buffer, is incremented when reading the message. Range of the address is incremented only up to the length of the message (is part of the received frame). |
FreescaleCAN |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
FreescaleCAN |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: GetAccHitIndicator, GetAbortMessageAck, GetSleepAck, ClearSleepRequest, SetSleepRequest, GetStateTX, BusOffRecoveryRequest |
PWMMC |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
PWMMC |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Typecast between pointers is used in SetOutput,Swap methods for conversion between bit-field structure type and byte type. |
PWMMC |
12.10 |
Required |
Description: The comma operator shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 12.10, comma operator used
|
Comma operator is used in 'Load' macro (optimization for code size). The rule is disabled for 'Generate macros = no' option (Build Options) |
PWMMC |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: Load |
SPI2UART |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
SPI2UART |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
Term |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Conversion between pointer to char type and pointer to unsigned char type is used in ReadChar method to receive characters. |
Init_PTU |
12.8 |
Required |
Description: The right-hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left-hand operand
PC-Lint message: Warning 572: Excessive shift value (precision 0 shifted right by 8) [MISRA 2004 Rule 12.8]
|
It is not possible to determine amount of shift of the address value, because user may enter address derectly (number) or a by reference (pointer). This warning occurs in case of address lower than 65536 is entered. |
Init_ADC |
12.8 |
Required |
Description: The right-hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left-hand operand
PC-Lint message: Warning 572: Excessive shift value (precision 0 shifted right by 8) [MISRA 2004 Rule 12.8]
|
It is not possible to determine amount of shift of the address value, because user may enter address derectly (number) or a by reference (pointer). This warning occurs in case of address lower than 65536 is entered. |
InternalI2C |
16.7 |
Advisory |
Description: A pointer parameter in a function prototype should be declared as pointer to const if the pointer is not used to modify the addressed object.
PC-Lint message: Info 818: Pointer parameter could be declared as pointing to const [MISRA 2004 Rule 16.7]
|
'Ptr' parameter of SendBlock method can be declared as const but only in specific component's setting. User interface should be uniform for all settings of the component, that's why 'const' is not used. |
InternalI2C |
17.1 |
Required |
Description: Pointer arithmetic shall only be applied to pointers that address an array or array element
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Pointer arithmetic is used for user buffer access. The buffer is allocated by the user and handed over in a method parameter for SendBlock and RecvBlock methods. Additional parameter specifies length of the buffer - pointer is manipulated only in the range between 0 and length of the buffer. |
InternalI2C |
17.2 |
Required |
Description: Pointer subtraction shall only be applied to pointers that address elements of the same array.
PC-Lint message: Note 946: Relational or subtract operator applied to pointers [MISRA 2004 Rules 17.2 and 17.3]
|
Internal circular buffer is used to store data send/received to/from communication bus in slave mode only (If input or output data buffer is enabled). Pointer subtraction is used to check if read/write pointer is not out of circular buffer range. |
InternalI2C |
17.4 |
Required |
Description: Array indexing shall be the only allowed form of pointer arithmetic.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
Internal circular buffer is used to store data send/received to/from communication bus (If input or output data buffer is enabled). Pointer arithmetic is used for manipulation with this buffer. |
InternalI2C |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: RecvChar, GetMode,CheckBus |
FreescaleEMAC |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
NE64ethernet |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
PE_Timer |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
PE_Timer |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macros: LngHi5, LngHi6 |
PC-Lint Configuration for HCS12,HCS12X,HCS12Z Derivatives
MISRA compliance was checked using PC-Lint tool version 9.00d with the following specific options:
co-mwhc12.lnt /* Use PC-lint specific configuration file for HC12 compiler */
-dasm=_to_semi /* Ignore asm block */
+rw(_to_semi)
-d__asm=asm /* Ignore __asm */
-ident1(@) /* ignore "@" and following brackets */
+rw(_to_brackets)
-d"@=_to_brackets "
-d__interrupt= /* Ignore __interrupt */
-dinterrupt= /* Ignore interrupt */
-dnear= /* Ignore near */
-dfar= /* Ignore far */
-$ /* Ignore "$" in asm blocks */
Kinetis Derivatives
Required documentation for Kinetis Derivatives
Rule |
Type |
Rule Description |
Documentation |
3.1 |
Required |
All usage of implementation-defined behavior shall be documented. |
- Follows the list of implementation dependent behavior used in Processor Expert. See documentation of CodeWarrior MCU Build tools for more information on topics not specified below:
- Program overloads void __init_hardware(void) function from the standard startup to provide initialization of clocks and external bus early after reset, see Reset Scenario.
- Program is finished at the end of main function in the infinite loop.
- Execution character set and corresponding values are documented in rule 3.2 in this table.
- Volatile declarations are used to access peripheral registers (memory mapped).
- Pragma directives are used and commented in the source code. See also documented rule 3.4 in this table.
|
3.2 |
Required |
The character set and the corresponding encoding shall be documented. |
Basic character set (see ISO 9899) is used in execution character set. Execution character set uses ASCII encoding (possible codes 0-255). Exception to basic character set: Term component uses NULL(0x00), CR (0x0D), LF(0x0A). |
3.3 |
Advisory |
The implementation of integer division in the chosen compiler should be determined, documented and taken into account. |
The way a Compiler implements division and modulo for negative operands is determined by the hardware implementation of the target's division instructions. See documentation of CodeWarrior S12(X) Build tools for more information. |
3.4 |
Required |
All uses of the #pragma directives shall be documented and explained. |
- Some components use pragma directive to determine the memory segment, where code and/or data will be used (see below). All other uses of #pragma directives are commented in the generated source code.
|
General Exceptions for Kinetis Derivatives
Rule |
Type |
Rule Description |
Reason |
12.10 |
Required |
The comma operator shall not be used. |
Comma operator is used in PDD macros. |
13.7 |
Required |
Boolean operations whose results are invariant shall not be permitted. |
PDD macros define constants that can be passed as parameters to these macros. |
14.2 |
Required |
All non-null statements shall either: a) have at least one side effect however executed, or b) cause control flow to change. |
Some PDD macros have two commas in the macro implementation. |
14.7 |
Required |
A function shall have a single point of exit at the end of the function. |
Use of multiple return statements simplifies the code logic. |
18.4 |
Required |
Unions shall not be used. |
Unions are used to efficiently swap bytes in a 16-bit word or 32-bit long word, to allow access to single memory location using multiple register names, or to allow simultaneous 32-bit, 16-bit or 8-bit access to single memory location. |
Component Exceptions for Kinetis Derivatives
Component |
Rule |
Type |
Rule Details |
Reason |
PE_Types.h |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
PE_Types.h |
2.1 |
Required |
Description: Assembly language shall be encapsulated and isolated.
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The file contains ASM language, but it is isolated in C macros. |
PE_Types.h |
10.1 |
Required |
Description: The value of an expression of integer type shall not be implicitly converted to a different underlying type.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 10.1, Implicit conversion of integer to smaller type
|
Call of the library function __set_FAULTMASK(). The code violates this rule for IAR compiler only. |
PE_Types.h |
19.13 |
Advisory |
Description: The # and ## preprocessor operators should not be used.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.13, '#/##' operator used
|
Used to convert bit name to bit mask in macros accessing registers. |
Cpu |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
Cpu |
2.1 |
Required |
Description: Assembly language shall be encapsulated and isolated.
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The file contains ASM language, but it is isolated in C macros. |
Cpu |
6.3 |
Advisory |
Description: Typedef that indicates size and signedness should be used in place of basic types.
PC-Lint message: Info 970: Use of modifier or type 'int' outside of a typedef [MISRA Rule 6.3]
|
The type of the function is defined by tool set. ProcessorExpert definition must comply.. |
Cpu |
8.10 |
Required |
Description: All declarations and definitions of objects or function at file scope shall have internal linkage unless external linkage is required.
PC-Lint message: Info 765: external 'function' could be made static [MISRA 2004 Rule 8.10]
|
Device Initialization - ISR declaration is subject of various modifications by the user and may or may not be copied to another module - static is not used. |
Vectors.c |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
Vectors.c |
2.1 |
Required |
Description: Assembly language shall be encapsulated and isolated.
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
Vectors.c |
8.10 |
Required |
Description: All declarations and definitions of objects or function at file scope shall have internal linkage unless external linkage is required.
PC-Lint message: Info 765: external 'function' could be made static [MISRA 2004 Rule 8.10]
|
Device Initialization - ISR declaration is subject of various modifications by the user and may or may not be copied to another module - static is not used. |
Vectors.c |
11.4 |
Advisory |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Need to explicitly cast pointers to the general ISR for Interrupt vector table |
FLASH_LDD |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
IO_Map.h |
1.4 |
Required |
Description: The compiler/linker shall be checked to ensure that 31 character significance and case sensitivity are supported for external identifiers.
PC-Lint message: Note Warning 621: Identifier clash [MISRA 2004 Rules 1.2, 1.4 and 5.1]
|
IO map defines register access constants. The constants' names contain peripheral name, register name, bit name and suffix _MASK/_SHIFT. |
IO_Map.h |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
IO map is based on structures and typecasting from a peripheral base address (integer constant) to a pointer type is used to get a pointer to the given peripheral structure used to access a peripheral registers. |
IO_Map.h |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to allow access to single memory location using multiple register names, or to allow simultaneous 32-bit, 16-bit or 8-bit access to single memory location. |
CAU_LDD |
3.6 |
Required |
Description: All libraries used in production code shall be written to comply with the provision of this document and shall have been subject to appropriate validation.
PC-Lint message: MISRA Compliancy Review (part of formal technical review)
|
CAU component uses an external CAU library that is not MISRA compliant. CAU component's code itself is MISRA compliant. |
Main.c |
6.3 |
Advisory |
Description: Typedef that indicates size and signedness should be used in place of basic types.
PC-Lint message: Info 970: Use of modifier or type 'int' outside of a typedef [MISRA Rule 6.3]
|
The type of the function is defined by tool set. ProcessorExpert definition must comply.. |
SDHC_LDD |
10.1 |
Required |
Description: The value of an expression of integer type shall not be implicitly converted to a different underlying type.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 10.1, Implicit conversion of integer to smaller type
|
Cannot shift by a value resulting from a complex expression. |
SDHC_LDD |
12.1 |
Advisory |
Description: Limited dependence should be placed on C's operator precedence rules in expressions.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 12.1, dependence placed on C's operator precedence; operators: ',' and ','
|
Comma operator separates expressions in PDD macros. |
Serial_LDD |
11.4 |
Advisory |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Conversion between pointer to void type and pointer to uint8_t/uint16_t type is used in ISR (transmitting/receiving characters). |
Serial_LDD |
12.8 |
Required |
Description: The right-hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left-hand operand.
PC-Lint message: Warning 572: Excessive shift value (precision 2 shifted right by 8) [MISRA 2004 Rule 12.8]
|
PDD macros use shift operations that can cause MISRA violations when a constant with value less than 256 is passed as an argument. |
SPIMaster_LDD |
11.4 |
Advisory |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Conversion between pointer to void type and pointer to uint8_t/uint16_t type is used in ISR (transmitting/receiving characters). |
SPISlave_LDD |
11.4 |
Advisory |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Conversion between pointer to void type and pointer to uint8_t/uint16_t type is used in ISR (transmitting/receiving characters). |
SSI_LDD |
11.4 |
Advisory |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Conversion between pointer to void type and pointer to uint8_t/uint16_t type is used in ISR (transmitting/receiving characters). |
USB_LDD |
11.4 |
Advisory |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Conversion between pointers is used in StartTransaction, HostQueueTransfer and Init methods. |
Ethernet_LDD |
12.1 |
Advisory |
Description: Limited dependence should be placed on C's operator precedence rules in expressions.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 12.1, dependence placed on C's operator precedence; operators: ',' and ','
|
Comma operator separates expressions in PDD macros. |
Ethernet_LDD |
12.8 |
Required |
Description: The right-hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left-hand operand.
PC-Lint message: Warning 572: Excessive shift value (precision 2 shifted right by 8) [MISRA 2004 Rule 12.8]
|
Macro for endianness conversion cannot be used on constants. |
Ethernet_LDD |
12.11 |
Advisory |
Description: Evaluation of constant unsigned integer expressions should not lead to wrap-around.
PC-Lint message: Warning 648: Overflow in computing constant for operation: 'unsigned shift left' [MISRA 2004 Rule 12.11]
|
Macro for endianness conversion cannot be used on constants. |
TimerUnit_LDD |
12.8 |
Required |
Description: The right-hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left-hand operand.
PC-Lint message: Warning 572: Excessive shift value (precision 2 shifted right by 8) [MISRA 2004 Rule 12.8]
|
One of predefined constants for macro LPTMR_PDD_SetDivider has value 1. |
PC-Lint Configuration for Kinetis Derivatives
MISRA compliance was checked using PC-Lint tool version 9.00d with the following specific options:
HCS08,RS08,ColdFire V1 Derivatives
Required documentation for HCS08,RS08,ColdFire V1 Derivatives
Rule |
Type |
Rule Description |
Documentation |
General Exceptions for HCS08,RS08,ColdFire V1 Derivatives
Rule |
Type |
Rule Description |
Reason |
1.1 |
Required |
All code shall conform to ISO 9899-1990 (C-code guideline) |
All components may contain one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
2.4 |
Advisory |
Sections of code should not be 'commented out'. |
Each init component contains 'Commented out' example of interrupt service routine (ISR), if generation of the ISR is enabled. |
12.10 |
Required |
The comma operator shall not be used. |
Comma operator is used in macros for simple methods (optimization for code size). The rule is globally disabled for 'Generate macros = yes' option (Build Options) |
14.7 |
Required |
A function shall have a single point of exit at the end of the function. |
Use of multiple return statements simplifies the code logic. |
19.7 |
Advisory |
A function should be used in preference to a function-like macro. |
Macros are used to optimize simple methods for code size. The rule is globally disabled for 'Generate macros = yes' option (Build Options). |
19.15 |
Required |
Precautions shall be taken in order to prevent the contents of a header file being included twice. |
All generated header files contain associated macro, which definition is tested. The headers file's content is included only if the macro is not defined. |
Component Exceptions for HCS08,RS08,ColdFire V1 Derivatives
Component |
Rule |
Type |
Rule Details |
Reason |
PE_Types.h |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
PE_Types.h |
14.3 |
Required |
Description: A null statement shall only occur on a line by itself
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 14.3, null statement not in line by itself
|
Several inline asm instructions are in one line separated by semicolon (asm() is ignored by PC-lint). |
PE_Types.h |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
PE_Types.h |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macro: All macros for register access, __DI, __EI, EnterCritical, ExitCritical, SaveStatusReg, RestoreStatusReg, PE_DEBUGHALT, ISR |
PE_Types.h |
19.12 |
Required |
Description: There shall be at most one occurrence of the # or ## preprocessor operators in a single macro definition.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 19.12, Multiple use of '#/##' operators in macro definition
|
Multiple occurrences of preprocessor operators are used to convert bit name to bit mask in macros for accessing peripheral registers. |
PE_Types.h |
19.13 |
Advisory |
Description: The # and ## preprocessor operators should not be used.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.13, '#/##' operator used
|
Used to convert bit name to bit mask in macros accessing registers. |
IO_Map.h |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
IO_Map.h |
5.1 |
Required |
Description: Identifiers (internal and external) shall not rely on the significance of more than 31 characters.
PC-Lint message: Warning 621: Identifier clash [MISRA 2004 Rules 1.2, 1.4 and 5.1]
|
Length of register identifiers of peripheral modules are sometimes longer than 31 characters to comply with the Reference Manual. |
IO_Map.h |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
IO_Map.h |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
IO_Map.h |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macro: __RESET_WATCHDOG |
Vectors.c |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
Cpu |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
Cpu |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Info 740: Unusual pointer cast (incompatible indirect types) [MISRA 2004 Rule 1.2]
|
When writing to FLASH memory in SetBackdoorKey method, the routine performing the write operation is copied to RAM memory and run in the RAM memory. Pointer cast of the routine is used for copy of the routine to the RAM memory and for call of the routine in RAM.; In the interrupt vector table in Device Initialization for ColdFire V1 derivatives, stack pointer is initialized by typecast of a pointer to the pointer to function. |
Cpu |
8.10 |
Required |
Description: All declarations and definitions of objects or function at file scope shall have internal linkage unless external linkage is required.
PC-Lint message: Info 765: external 'function' could be made static [MISRA 2004 Rule 8.10]
|
Device Initialization - ISR declaration is subject of various modifications by the user and may or may not be copied to another module - static is not used. |
Cpu |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
Internal oscillator trim register is initialized by typecasting storage address of a trim value to the pointer; When Interrupt vector table is generated into RAM, pointers to ISR functions are initialized by typecast of an integral value to the function pointer type. Typecast from pointer to integral type is also used in SetIntVect method when checking parameter value; SetBackdoorKey method uses typecast from pointer to integral to pass parameter to high level inline assembly routine placed in RAM. In interrupt vector table in Device Initialization, unassigned ISR are initialized by typecast of an integral value to the function pointer type. |
Cpu |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
When writing to FLASH memory in SetBackdoorKey method, the routine performing the write operation is copied to RAM memory and run in the RAM memory. Pointer cast of the routine is used for copy of the routine to the RAM memory and for call of the routine in RAM.; In the interrupt vector table in Device Initialization for ColdFire V1 derivatives, stack pointer is initialized by typecast of a pointer to the pointer to a function. |
Cpu |
12.4 |
Required |
Description: The right-hand operand of a logical && or || operator shall not contain side effects.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 12.4, side effects on right hand of logical operator
|
In Device Initialization for RS08 derivatives that supports interrupt vector, in ISR dispatcher two status register are scanned in one while condition using || operator. Short evaluation of a condition is not important, because the ISR dispatcher scans the variables in the loop. |
Cpu |
14.2 |
Required |
Description: All non-null statements shall either: a) have at least one side effect however executed, or b) cause control flow to change.
PC-Lint message: Warning 522: Highest operation, function 'string', lacks side-effects [MISRA 2004 Rule 14.2]
|
PC-lint reports the warning for 'Delay100US' method, which is a wrapper for inline asm block (asm block is ignored by PC-lint); PC-lint may report the warning in Device Initialization for RS08 derivatives that supports interrupt vector. In interrupt service routine, empty sub-routines templates for each peripheral interrupt are called. |
Cpu |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: GetPllLockStatusFlag, GetLowVoltageFlag, SetStopMode, SetWaitMode, DisableInt, EnableInt, GetSpeedMode |
IntFlash |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
IntFlash |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Info 740: Unusual pointer cast (incompatible indirect types) [MISRA 2004 Rule 1.2]
|
When writing to FLASH memory, the routine waiting for write operation completion is copied to RAM memory and run in the RAM memory. Pointer cast of the wait routine is used for copy of the routine to the RAM memory. |
IntFlash |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
Driver writing to FLASH memory uses pointer type for accessing data in the memory and integer type for manipulation and storage of the address to memory. Conversion between both types is needed and performed by the typecast between integral type and pointer type. |
IntFlash |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
When writing to FLASH memory, the routine performing the write operation is copied to RAM memory and run in the RAM memory. Pointer cast is used for copy of the routine to the RAM memory and for call of the routine in RAM.; When Virtual page is enabled, it's possible to write or read a byte, a word or a double word to or from Virtual page (GetBytePage, SetBytePage, GetWordPage, SetWordPage, GetLongPage and SetLongPage methods). Pointer cast of the Virtual Page array to the desired type is used in these methods. |
IntFlash |
16.7 |
Advisory |
Description: A pointer parameter in a function prototype should be declared as pointer to const if the pointer is not used to modify the addressed object.
PC-Lint message: Info 818: Pointer parameter could be declared as pointing to const [MISRA 2004 Rule 16.7]
|
'Source' parameter of SetBlockFlash method can be declared as const but only in specific component's setting (Write method = Write or Safe write). User interface should be uniform for all settings of the component, that's why 'const' is not used. |
IntFlash |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
IntFlash |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macro: Busy, EnableEvent, DisableEvent |
IntEEPROM |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
IntEEPROM |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Info 740: Unusual pointer cast (incompatible indirect types) [MISRA 2004 Rule 1.2]
|
When writing to FLASH memory, the routine waiting for write operation completion is copied to RAM memory and run in the RAM memory. Pointer cast of the wait routine is used for copy of the routine to the RAM memory. |
IntEEPROM |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
Driver for D-Flash memory type writing to EEPROM memory uses pointer type for accessing data in the memory and integral type for manipulation and storage of the address to memory. Conversion between both types is needed and performed by the typecast between integral type and pointer type. |
IntEEPROM |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
The EEPROM peripheral module (D-Flash memory type) works with two data bytes (word) for write operation, but access to one byte is needed (GetByte, SetByte methods). Conversion between the pointer to byte and pointer to word is used and typecast for pointer arithmetic is used. |
IntEEPROM |
16.7 |
Advisory |
Description: A pointer parameter in a function prototype should be declared as pointer to const if the pointer is not used to modify the addressed object.
PC-Lint message: Info 818: Pointer parameter could be declared as pointing to const [MISRA 2004 Rule 16.7]
|
'Addr' parameter of EraseEeprom method is unused if SetActByte and GetActByte methods are disabled. User interface should be uniform for all settings of the component, that's why 'const' is not used. |
SW_I2C |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
SW_I2C |
14.2 |
Required |
Description: All non-null statements shall either: a) have at least one side effect however executed, or b) cause control flow to change.
PC-Lint message: Warning 522: Highest operation, function 'string', lacks side-effects [MISRA 2004 Rule 14.2]
|
PC-lint reports the warning for 'Delay' function, which is a wrapper for inline asm block (asm block is ignored by PC-lint). |
Init_SAW |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
Init_SAW |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
SAW internal oscillator trim register is initialized by typecasting storage address of a trim value to the pointer. |
Init_SAW |
14.2 |
Required |
Description: All non-null statements shall either: a) have at least one side effect however executed, or b) cause control flow to change.
PC-Lint message: Warning 522: Highest operation, function 'string', lacks side-effects [MISRA 2004 Rule 14.2]
|
PC-lint reports the warning for 'Delay' function, which is a wrapper for inline asm block (asm block is ignored by PC-lint). |
InternalI2C |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
InternalI2C |
14.2 |
Required |
Description: All non-null statements shall either: a) have at least one side effect however executed, or b) cause control flow to change.
PC-Lint message: Warning 522: Highest operation, function 'string', lacks side-effects [MISRA 2004 Rule 14.2]
|
PC-lint reports the warning for 'Delay' function, which is a wrapper for inline asm block (asm block is ignored by PC-lint). |
AsynchroSerial |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
AsynchroSerial |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
AsynchroSerial |
12.4 |
Required |
Description: The right-hand operand of a logical && or || operator shall not contain side effects.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 12.4, side effects on right hand of logical operator
|
The code is accessing two volatile varibles in a condition. The order of access to variables is not important, because the variables are not mutualy dependent. Short evaluation of the condition is not importatnt in this case. |
AsynchroSerial |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
AsynchroSerial |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: Standby, LoopMode, SetDirection, TurnRxOff, TurnRxOn, TurnTxOff, TurnTxOn, GetTxComplete |
BitIO |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
FreescaleAnalogComp |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
Init_IRTC |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
Init_PRACMP |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
ExtInt |
1.1 |
Required |
Description: All code shall conform to ISO 9899-1990 (C-code guideline)
PC-Lint message: Note 950: Non-ANSI reserved word or construct [MISRA 2004 Rules 1.1 and 2.2]
|
The component contains one of non-ANSI C reserved word or construct used as specific language extensions: @, asm, __asm, near, __near, far, interrupt, __interrupt. |
ExtInt |
16.8 |
Required |
Description: All exit paths from a function with non-void return type shall have an explicit return statement with an expression.
PC-Lint message: Warning 533: function should return a value [MISRA 2004 Rule 16.8]
|
Function contains inline assembler instructions to get value of pin not associated with any port. |
ExtInt |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macro: Enable, Disable,GetVal |
ADC |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Note 931: Both sides have side effects [MISRA 2004 Rule 1.2]
|
PC-Lint reports for summing of the calibration registers values by Calibrate method. The variable in header file for access to each calibration register is declared as volatile, but the order of register access is not important for setting the gain registers, because the registers used for summing are not changed after the automatic calibration end. |
ADC |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
To ensure the high byte of the 16.bit result register is read first, both bytes are read separately and joined using the typecast to pointer to a structure. |
ADC |
12.4 |
Required |
Description: The right-hand operand of a logical && or || operator shall not contain side effects.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 12.4, side effects on right hand of logical operator
|
The code is accessing a register and a volatile varible in a condition. The order of access is not important, because the variable and register are not mutualy dependent. Short evaluation of the condition is not importatnt in this case. |
PE_Cnvrt.c |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Note 931: Both sides have side effects [MISRA 2004 Rule 1.2]
|
PC-Lint reports for operations with status variables (EnChan, EnChanFlags, ChRun). The variables are declared as volatile, but the order of variables access is not important, because the variables are not mutualy dependent. |
PE_Cnvrt.c |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
To ensure the high byte of the 16.bit result register is read first, both bytes are read separately and joined using the typecast to pointer to a structure. |
MeasurementEngine |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Note 931: Both sides have side effects [MISRA 2004 Rule 1.2]
|
PC-Lint reports for summing of the calibration registers values by ADC_Calibrate method. The variable in header file for access to each calibration register is declared as volatile, but the order of register access is not important for setting the gain registers, because the registers used for summing are not changed after the automatic calibration end. |
MeasurementEngine |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Typecast between pointers is used when an array of pointers is accessed, which contains register addresses. |
Byte2IO |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Note 931: Both sides have side effects [MISRA 2004 Rule 1.2]
|
PC-Lint reports for reading the input value by GetVal method from several ports. The variable in header file for access to each port register is declared as volatile, but the order of register access is not important (neglected) for IO access. |
Byte3IO |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Note 931: Both sides have side effects [MISRA 2004 Rule 1.2]
|
PC-Lint reports for reading the input value by GetVal method from several ports. The variable in header file for access to each port register is declared as volatile, but the order of register access is not important (neglected) for IO access. |
Byte4IO |
1.2 |
Required |
Description: No reliance shall be placed on undefined or unspecified behavior
PC-Lint message: Note 931: Both sides have side effects [MISRA 2004 Rule 1.2]
|
PC-Lint reports for reading the input value by GetVal method from several ports. The variable in header file for access to each port register is declared as volatile, but the order of register access is not important (neglected) for IO access. |
FreeMaster |
4.1 |
Required |
Description: Only those escape sequences that are defined in the ISO C standard shall be used
PC-Lint message: Note 960: Violates MISRA Rule 4.1, Prohibited escape sequence used(hexadecimal)
|
Implement TSA "Base Types" as a one-char strings |
FreeMaster |
11.3 |
Advisory |
Description: A cast should not be performed between a pointer type and an integral type.
PC-Lint message: Note 923: cast from 'integer type' to pointer [Encompasses MISRA 2004 Rules 11.1 and 11.3], [MISRA 2004 Rule 11.3]
|
AHWT.c file: Convert the result of getWDBuint16 function to data address. |
FreeMaster |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Actually this cast is performed between a pointer to object type and the same pointer to object type (FMSTR_BPTR a; a = (FMSTR_BPTR)(a);) |
FreeMaster |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
FreeMaster |
19.6 |
Required |
Description: #undef should not normally needed.
PC-Lint message: Note 960: Violates MISRA Rule 19.6, use of '#undef' is discouraged
|
Used before a macro overwrite operation. |
FreeMaster |
19.13 |
Advisory |
Description: The # and ## preprocessor operators should not be used.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.13, '#/##' operator used
|
Used to specify what table to be used. |
AsynchroMaster |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
AsynchroMaster |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
AsynchroMaster |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following methods: Standby, LoopMode, SetDirection, TurnRxOff, TurnRxOn, TurnTxOff, TurnTxOn, GetTxComplete |
AsynchroSlave |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
AsynchroSlave |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
SynchroMaster |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
SynchroMaster |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
SynchroSlave |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
SynchroSlave |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
PWMMC |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
PWMMC |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Typecast between pointers is used in SetRatio16 method for ratio calculation. |
PWMMC |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
SPI2UART |
6.4 |
Required |
Description: Bit-field shall only be defined to be of type unsigned int or signed int.
PC-Lint message: Error 46: field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4]
|
Unsigned char type is used in bit-fields as smallest possible type. |
SPI2UART |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
RTC |
10.3 |
Required |
Description: The value of a complex expression of integer type may only be cast to a type that is narrower and of the same signedness as the underlying type of the expression.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 10.3, Cast of complex expression changes signedness
|
For IRTC peripheral module, the value of a year in the register is represented by a signed value, but the interface of the component uses unsigned value. Typecast of na expression to unsigned value is used due to less code size. |
Term |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Conversion between pointer to char type and pointer to unsigned char type is used in ReadChar method to receive characters. |
Capture |
11.4 |
Required |
Description: A cast should be not be performed between a pointer to object type and different pointer to object type
PC-Lint message: Note 929: cast from pointer to pointer [MISRA 2004 Rule 11.4]
|
Typecast between pointers is used in GetCaptureValue method in case, it is generated as a macro. |
WatchDog |
12.10 |
Required |
Description: The comma operator shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 12.10, comma operator used
|
Comma operator is used in 'Clear' macro (optimization for code size). The rule is disabled for 'Generate macros = no' option (Build Options) |
WatchDog |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macro: Clear |
FreescaleCAN |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
PE_Timer |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
PE_Timer |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macros: LngHi5 |
PPG |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
PWM |
18.4 |
Required |
Description: Unions shall not be used.
PC-Lint message: Note 960: Violates MISRA 2004 Required Rule 18.4, unions shall not be used
|
Unions are used to efficiently swap bytes in a word or long word, to allow simple access to bit-field and to allow access to bits of registers for peripheral modules. |
LCD |
19.7 |
Advisory |
Description: A function should be used in preference to a function-like macro.
PC-Lint message: Note 961: Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined
|
Macros are used to optimize simple methods for code size. The rule is disabled for 'Generate macros = no' option (Build Options) for following macro: SetPixel, GetPixel |
PC-Lint Configuration for HCS08,RS08,ColdFire V1 Derivatives
MISRA compliance was checked using PC-Lint tool version 9.00d with the following specific options:
co-mwhc08.lnt /* Use PC-lint specific configuration file for HC12 compiler */
-dasm=_to_semi /* Ignore asm block */
+rw(_to_semi)
-d__asm=asm /* Ignore __asm */
-ident1(@) /* ignore "@" and following brackets */
+rw(_to_brackets)
-d"@=_to_brackets "
-d__interrupt= /* Ignore __interrupt */
-dinterrupt= /* Ignore interrupt */
-dnear= /* Ignore near */
-d__near= /* Ignore __near */
-dfar= /* Ignore far */
-dCONVERT_TO_PAGED= /* Ignore CONVERT_TO_PAGED (in RS08 project only) */
-$ /* Ignore "$" in asm blocks */
56800(E) Derivatives
MISRA 2004 is not supported yet.
ColdFire V2-V4 Derivatives
MISRA 2004 is not supported yet.
|