This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL2-RM57L: Solution to MISRA C warnings in SCI Module

Part Number: LAUNCHXL2-RM57L
Other Parts Discussed in Thread: HALCOGEN

Hi,

I am trying to remove MISRA C warnings of SCI(UART) Module. In halcogen I enabled SCI1 and I generated the code. I Could not remove the following required warnings. Please Help

1. (MISRA-C : 2004 1.1/R)Ensure strict ANSI C mode(-ps) is enabled

Above warning is showing in the following places

a) typedef signed char  __int8_t; [ Warning from "_types.h" ]

b) typedef unsigned int  uint32_t; [ Warning from "HL_errata_SSWF021_45_defs.h"]

2. (MISRA-C : 2004 10.3/R) The value of a complex expression of integer type shall only be cast to a type of the same signedness that is no wider than the underlying type of the expression

Above warning is showing in the following place

nmpu->MPUREGSENA = ((uint32)(config.regionsize)<<1U)|1U;

Here,

MPUREGSENA is defined as uint32

regionsize is defined as nmpuReg_t  regionsize ;

typedef enum npuRegion

{

NMPU_REGION0 = 0U,

NMPU_REGION1 = 1U,

NMPU_REGION2 = 2U,

NMPU_REGION3 = 3U,

NMPU_REGION4 = 4U,

NMPU_REGION5 = 5U,

NMPU_REGION6 = 6U,

NMPU_REGION7 = 7U

} nmpuReg_t

3. The names of standard library macros, objects and functions shall not be reused(" exit ") [HL_sys_startup.c]

The following comments have been given. Please elaborate

/* SAFETYMCUSW 122 S MR:20.11 <APPROVED> "startup code (exit and abort need to be present)"*/

/*SAFETYMCUSW 354 S MR:NA <APPROVED> "startup code[Extern declaration present in the library)"*/

exit is declared as

extern void exit(int _status)

it has been called in the same programme as exit(0)