September 2008
Intermediate to advanced
280 pages
6h 31m
English
If your editor is your first weapon in the battle against bugs, then your compiler is your second. All compilers have the ability to scan code and find common errors, but you usually have to enable this error checking by invoking the appropriate option.
Many of the compiler warning options, like GCC's -Wtraditional switch, are probably overkill except in special situations. However, don't even think about using GCC without using -Wall each and every time. For example, one of the most common mistakes that new C programmers make is illustrated by the following statement:
if (a = b)
printf("Equality for all!\n");
This is valid C code, and GCC will merrily compile it. The variable a is assigned the value of ...