We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have some code running on an 8051 based processor that is quite large and complex and it also uses a few arrays. To make sure that I can avoid mistakes accessing memory location that do not exist, I'd like to know if there are anyway to get the C51 Compiler to catch this type of mistakes.
BYTE xdata myArray[8] BYTE i; for (i=0;i<10;i++) myArray[i]=i;
The compiler has no problem with that and doesn't report memory leaks. Are there any ways to make the compiler to generate an error or even a warning?
Try doing some searches on "defensive programming". You might also have a look at the MISRA rules...
Would you elaborate on that,
"Would you elaborate on that"
Just put those terms into your favourite internet search engine, then you can learn about "defensive programming" and "the MISRA rules"...
Hint: "internet search engines" include Google, AltaVista, etc...