On Thu, Jan 24, 2008 at 09:43:23AM -0800, Tom Gal wrote:
> Unfortunately, first of all it's impossible to computationally detect an
> infinite loop. It's loosely the Halting Problem solved by Turing back in the
> old days.

It is impossible to write a *single* program that can detect *all* infinite
loops.

I can easily detect an infinite loop in C.  Watch this...


(pseudo code)

void infinite_loop_finder(char *program_text) {
        if (program_text contains "while (1) {;}") {
                printf("I found an infinite loop!\n");
        }
}

cs

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to