This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Infinite loops

Hi, How can we overcome infinite loops in C programming using keil compiler............ can anyone plz answer my question.... Actually i want to know
1)what are the adverse effects a program leads to when it contains a infinite loops in it.

2)how can u find them out means how u debug your program which contains infinite loops using keil debugger .

3)Does the keil compiler is useful to find such type of bugs(infinite loops) in a program are we have to rely on third party debugging tools.

4)How to overcome such bugs(infinite loops) in the program.

5)what are the neccessary measures to be taken to prevent infinite loops in a C program.....

thanks in advance............ bharath

Parents
  • The amount of questions kind of suggests that you are looking for answers to a school assignmnet.

    Anyway - there are no 100% proof methods to view C/C++ code and detect possible infinite loops. At least not in reasonably complex real-world code.

    If you get stuck in an infinite loop, it is trivial to find out where. Just break the execution and look where you are... Figuring out a good way to avoid the problem, or the interaction that caused it, can be a lot harder.

    So, be careful. Think before writing code. Think about timeouts and watchdog usage.

Reply
  • The amount of questions kind of suggests that you are looking for answers to a school assignmnet.

    Anyway - there are no 100% proof methods to view C/C++ code and detect possible infinite loops. At least not in reasonably complex real-world code.

    If you get stuck in an infinite loop, it is trivial to find out where. Just break the execution and look where you are... Figuring out a good way to avoid the problem, or the interaction that caused it, can be a lot harder.

    So, be careful. Think before writing code. Think about timeouts and watchdog usage.

Children
No data