Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
9.1 Variable may not have been initialized
#1
Hello,

I have an issue with MISRA 9.1 rule. In my code i have a "if" loop and inside that a variable is initialized and then is read after that. But when i do static analysis using pclint then i have a warning for 9.1 rule. Below is my code :

struct mgm2_info_return msg_ascu_info;
Code:
if(klr_ecuConf_t->feat_multislave)
    {
        msg_ascu_info = mgmF_massage_get_ascu_info();
    }
    msg_info = mgmF_massage_get_info();

The line where it is read and where warning occurs:
Code:
if( (((vF_mcms_fl_on((tm_uint8)V_FLONCMD_ACK)) ||
          (msg_info.pmcu_state ==  LDF_MASSSQC_STATE_ACTIVE))
                    &&((klr_ecuConf_t->feat_multislave)
                    || (msg_ascu_info.ascu_state ==  LDF_MASSSQC_STATE_ACTIVE))
        ) &&
        (msg_info.pmcu_trig_source == RqSource_ActvComf))

Do i need to write a justification or i need to initialize the entire structure first?
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)