>>i am terribly disappointed
Get over it
Maybe this has something:
This is a discussion on detect infinite loop in c program within the C Programming forums, part of the General Programming Boards category; >>i am terribly disappointed Get over it Maybe this has something: http://www.splint.org/...
there probably isn't a way to determine if it loops forever other than looking for things like
or writing an ASM parser looking for a CONDITION in a loop, other than that, have fun
> i agree with u frnd that it was proved that its unsolvable in 1936.. but there are things that have been chg later..
Well mathematical proofs tend to stand for all time - I don't see any need to worry about how long ago it was. I don't for example worry that pythagoras' theorem a*a + b*b = c*c will be dis-proved in any near future.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I can tell some of the mathematical proofs which are lying in dust and they were considered words of GOD one time.. nyways thats not my purpose ... i was looking for a solution rather than tryin ppl knowlege of maths ... and u may call it bad but if i cant solve a problem , i get disappointed.....
looks like i have to write a parser where i will look for possible loops, iknow it wont be one covering all the cases but it wil do for the time being..
till then if someone can think of ny better sol. i will appreciate....
One possible solution would be to have a reasonable time of execution/completion. The detector program would need to launch the program to be tested and continue to run concurrently. The detector would wait for the test program to return. While the test program executes, the detector uses the standard library function difftime() to compare the execution time of the test program to the reasonable time. If the test program does not return before the reasonable time is exceded the program is in an infinate loop.
This algorithm will only work for a specific input, but we know from Alan Turing's work that a solution that works for all inputs in not possible.