True artificial intelligence has not yet been achieved. C compilers are not intelligent, but unconscious: mechanical in the derogatory sense of the word. Therefore, debugging your programs can be a difficult process. A single typographical error can cause a compiler to completely misunderstand your code and generate a misleading error message. Sometimes a long string of compiler error messages are generated because of a single error in your code. To minimize the time you spend debugging, it is useful to become familiar with the most common compiler messages and their probable causes.
The first section in this chapter lists some of these common compile-time errors and what to do about them. The next two sections discuss run-time errors in general, and mathematical errors in particular. The final section introduces GDB, the GNU Debugger, and explains some simple steps you can take to debug your programs with it.