hi all,
pls let me know if there is any provision in KEIL A51 compiler to sport a message if there's a stack over flow in the codes. i.e. if the stack size assigned is small & the codes overtly push & pop.
thanx in advance,
regards,
Bala
Read-Only
Author Drew Davis
Posted 3-Aug-2003 21:26 GMT
Toolset None
RE: does KEIL compiler make out stack overflow?
Drew Davis
I don't see an option for the compiler to insert stack checks on functions calls.
It's perhaps worth pointing out that stack usage for 8051s in general and Keil in particular is somewhat unusual. The hardware stack is so small that little use is made of it in most cases. Function parameters, locals, and the like are assigned addresses at compile time based on the call tree of the program. A "stack overflow" is really more like a linker error message telling you that your data segments don't all fit.
Reentrant functions use a stack maintained by software. And the hardware stack does see some use, mostly for function return addresses (though those can be moved to the software stack if desired) and the rare bit of temporary storage.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.