Function local variables are not getting initialized

Hi,

Greetings!!!

I am using CS+ IDE and RL78/F14 micro controller.

In one of my function I am declaring a structure member and initializing while declaration.

But if I run the application, the structure member is not getting initialized.

For example:

struct tag_S {

  uint32 ID,

  uint8 dlc,

uint8 data[8];

};

void my_fun(void)

{

  tag_S message = {0x200, 8, {1, 2, 3, 4, 5, 6, 7, 8}};

  ... // my code

  ...

}

in the above my_fun(), the variable "message" is not getting updated as expected.

But, If I define the same variable globally, the variable is getting updated.

I could not understand what would be the issue.

Looking forward for your help in resolving the issue.

Thank you in advance,

Regards,

Ganesh