Still too many MISRA 2004 violation in MCAL

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
I just make a XC2000 MCAL project with ADC,DIO,PORT,MCU,GPT,IRQ.
I try to using MISRA2004 check tool in Tasking VX...
I know there are some MISRA2004 violation described in MCAL files...
But it still surprise me that MCAL still have too many MISRA2004 violation...
In my project, at least 74 violation are found with default custom check and 390 warning with all supported check.

Hope IFX to improve it, or the user can't check whether his code is violate MISRA2004... 😮
0 Likes
8 Replies
Markus_Kroh
Employee
Employee
Dear alexshao1978,

The MISRA violations in the MC-ISAR drivers are described within release notes which are included in the software package. Hence the MISRA violations are described and by intension.

Which driver package and version number are you using?

Best regards

Markus
0 Likes
Not applicable
The package I using now is below, from releasenotes of MCAL:
Product Name MC-ISAR_AS3x_XC2000_BASE_V001
Release Version 0.0.1
Type Of Release Alpha
Name of the Supplier Infineon Technologies AG
Mode of Release Infineon Security Server
Date of Release 02 June 2011

I kown every .c files will give explain such as in Mcu.c:
Information on MISRA violations:
- MISRA Rule 19.15: Repeated include file 'MemMap.h'
This warning cannot be avoided since inclusion of the file MemMap.h is done
for memory mapping of the code and data
The warning for Mcureg.h is a false alarm since the contents of the file
are not included repeatedly. This warning is not available while using
Tasking MISRA check
- MISRA Rule 19.1: Only preprocessor statements and comments before '#include'
Inclusion of the file MemMap.h is done for memory mapping of the code and
data. This violation cannot be avoided.
- MISRA Rule 19.7: Usage of function-like macro cannot be avoided
- MISRA Rule 11.1,11.3: cast from unsigned short to pointer
This violation occurs since the value of the address of an SFR is
type casted to a pointer.
- MISRA Rule 8.1:
Violation is for use of symbols '__int166', '_nop()', but cannot be
avoided
- MISRA Rule 14.7:
Multiple exit points for a function is done during error checks to exit
from the routine without performing any other functionality
- MISRA Rule 10.5: Shift right of signed quantity (int)
Violation occurs while shifting contents of SFRs, but cannot be avoided
- MISRA Rule 17.4: Pointer arithmetic should not be used
This rule is not considered for configuration pointers since the arithmetic
used on these pointers is done within the valid range.
- MISRA Rule 16.6: Too many arguments (3) for prototype 'Mcu_lCopyWords
(unsigned short)'. This is a false alarm since the number of arguments
passed to the function match the number of parameters.
- MISRA Rule 1.2: Undeclared identifier
The error is generated for compiler labels e.g., _lc_gb_mcu_code_psram_flash
whose usage cannot be avoided
0 Likes
Not applicable
The version is :
Product Name MC-ISAR_AS3x_XC2000_BASE_V001
Release Version 0.0.1
Type Of Release Alpha
Name of the Supplier Infineon Technologies AG
Mode of Release Infineon Security Server
Date of Release 02 June 2011
0 Likes
Not applicable
The version is:
Product Name MC-ISAR_AS3x_XC2000_BASE_V001
Release Version 0.0.1
Type Of Release Alpha
Name of the Supplier Infineon Technologies AG
Mode of Release Infineon Security Serve
0 Likes
Not applicable
The version is below:
Product Name MC-ISAR_AS3x_XC2000_BASE_V001
Release Version 0.0.1
Type Of Release Alpha
Name of the Supplier Infineon Technologies AG
Mode of Release Infineon Security Serve
0 Likes
Not applicable
Version Infomation:
Product Name MC-ISAR_AS3x_XC2000_BASE_V001
Release Version 0.0.1
Type Of Release Alpha
Name of the Supplier Infineon Technologies AG
Mode of Release Infineon Security Serve
0 Likes
Not applicable
Markus Kroh : Sorry I don't know why I can't reply post last days.
The MCAL version is like below:

Product Name MC-ISAR_AS3x_XC2000_BASE_V001
Release Version 0.0.1
Type Of Release Alpha?
Name of the Supplier Infineon Technologies AG
Mode of Release Infineon Security Server
Date of Release 02 June 2011
0 Likes
diantn
Employee
Employee
Welcome! First reply posted
Hi Alex,

PC-Lint (http://www.gimpel.com/html/pcl.htm) can be used for checking the MISRA-C of MCAL.
The Tasking doesn't support exclusion of MISRA-C of particular source code lines.
0 Likes