In the below example, I beleive that the char array buffer[40] should
only occupy 40 bytes of the stack within the inner braces.
However the compiler seems to use 40 bytes of the stack througout the
entire function that this example is cut from. Is this normal?
if(midnightflag ==1)
{
lcd_clear();
lcd_locate(1,1) ;
lcd_display("Up dating date");
{ unsigned char buffer[40];
daydateyear(buf fer);
senduart2(buffe r);
senduart2("\r\n ");
};
update_date();
midnightflag=0;
};
only occupy 40 bytes of the stack within the inner braces.
However the compiler seems to use 40 bytes of the stack througout the
entire function that this example is cut from. Is this normal?
if(midnightflag ==1)
{
lcd_clear();
lcd_locate(1,1) ;
lcd_display("Up dating date");
{ unsigned char buffer[40];
daydateyear(buf fer);
senduart2(buffe r);
senduart2("\r\n ");
};
update_date();
midnightflag=0;
};
Comment