MISRA Discussion Forums

Full Version: Rule 8.3 Function definition
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to just clarify that following is a MISRA violation before using it in my code. I am calling one function from a file as under:

Code:
(void)Dem_SetEventStatus((Dem_EventIdType)(dtcFlt_t.dtc[dtcIndex]), DEM_EVENT_STATUS_FAILED);

Here Dem_SetEventStatus is defined in one header as under:

Code:
extern FUNC(Std_ReturnType, RTE_CODE) Dem_SetEventStatus (Dem_ASR42_EventIdType EventId, Dem_ASR42_EventStatusType EventStatus);

Here Dem_EventIdType is a typedef of unit8 and Dem_ASR42_EventIdType is unsigned short.

So , there were the violation of MISRA 8.3 right??
Rule 8.3 concerns the types in the declaration and definition of a function.
It is not concerned with the types used in a function call.

However the example does violate rule 10.1 which does not permit the widening of types on a function call.