Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 1.2 Problem wih array parameter
#1
I'm using lint to check my code is MISRA Compliant. I have one funtion with buffer definition. This buffer (8 uint8) is passed by parameter to another function to manage it. I receive this message in "CAN_Get_DCDC_SUP_Status(aux_Can);"
"Note 934: Taking address of near auto variable 'aux_Can' (arg. no. 1) [MISRA 2004 Rule 1.2]"

I have following sippet code:

T_u16 CanId = (T_u16)0;
T_u8 aux_Can[8]={0U,0U,0U,0U,0U,0U,0U,0U};

CanId = ((T_u16)((T_u16)CAN0RIDR0 > 5U));

switch (CanId)
{
case ID_DCDC_SUP_Status:

aux_Can[0] = CAN0RDSR0;
aux_Can[1] = CAN0RDSR1;
aux_Can[2] = CAN0RDSR2;
aux_Can[3] = CAN0RDSR3;
aux_Can[4] = CAN0RDSR4;
aux_Can[5] = CAN0RDSR5;
aux_Can[6] = CAN0RDSR6;
aux_Can[7] = CAN0RDSR7;

CAN_Get_DCDC_SUP_Status(aux_Can);
(....)


The funciton is

void CAN_Get_DCDC_SUP_Status(T_u8 *aux_Can)
{
T_u16 temp=0;

/*Byte 0*/
aux_Can[0]=aux_Can[0]>>1;
SetU2_DCDC_SUP_HVBatt_OC(aux_Can[0] & 0x03);
aux_Can[0]=aux_Can[0]>>2;
SetB_DCDC_SUP_DRV1_Fault(aux_Can[0] & 0x1);
(...)


with prototype (in header file):


void CAN_Get_DCDC_SUP_Status(T_u8 *aux_Can);


Does anyone has explanation/solution?

Best Regards
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)