AnsweredAssumed Answered

About 5744p stack initial

Question asked by liu jinhang on Sep 26, 2016
Latest reply on Sep 26, 2016 by stanish


if there is a function likes bellow:

void Func_A(void)


   unsigned int a;   

   unsigned int b = 0;



can we make sure the local variables 'a' and 'b' are all zero when Func_A is called?

if we can't make sure 'a' will be zero, how can we do to make sure that?

i know one way of coding like below:

unsigned int a = 0;   

but some times i can not make sure all local variables are all initialed.  how can i do to make compiler to initial all un-initialled local variables to zero before running the functions?


PS: my compiler is Green Hills.