On Mon, 2004-10-04 at 10:15, Wouter van Ooijen wrote: > > My "problem" with this sort of "feature" is it tends to HIDE > > PROBLEMS IN > > CODE. Main "ending" is a hard enough bug to find if you're not looking > > for it, imagine how much harder it becomes if the compiler hides the > > fact from you that there IS a problem?? > > So what do you propose the compiler to insert after the main? It can't > honk a horn unless you connect one, so I see a few alternatives: 'idle: > goto idle', 'sleep' (maybe even 'idle: sleep; goto sleep'), 'goto 0'. > Doing nothing will in most cases be the same as 'goto 0' because the > all-ones opcode on most PICs will simply execute untill the PC wrapsa > round to 0. As far as I can see each alternative will hide some > problems. As is the case with the simple 2 line program you are right, doing nothing will have the same effect as looping to the beginning. But doing nothing is FAR more useful in the case of having more then just a two line program. Operation will show a huge amount of craziness going on, and when I see craziness of that proportion happening (routines being run out of nowhere) I would start to suspect having done something done like that. Looping back to start OTOH, if I didn't know the compiler did it, would instead have me hunting "PIC reboots randomly" issues, which are far from obvious to hunt down (flaky power supply, noise on reset pin, watch dog going, etc.), and chances are I would waste many hours hunting down a problem who's symptoms were changed because some person decided their compiler did something non obvious. Imagine a doctor trying to diagnose what the problem is when your little toe hurting is a symptom of a heart attack because the pill the patience was taking changed the symptom (which the doctor didn't know) from "chest pain" to "little toe hurting"... ----------------------------- Herbert's PIC Stuff: http://repatch.dyndns.org:8383/pic_stuff/ _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist