Mail Archives: djgpp/1998/12/30/03:51:27
On Tue, 29 Dec 1998, Stuart Hall wrote:
> What I wonder is, what are the useful flags to use for a newbie
> programmer?
The best combination of flags is "-Wall -O" (that's a capital o, not a
zero). The reason for -O is that some sophisticated tests are only
performed by the compiler as part of optimizing the code, so you could
miss some warnings if you compile without -O.
-Wall catches a lot of dubious (aka: buggy) code. If you want even
more diagnostics, add these switches to -Wall:
-W
-Wbad-function-cast
-Wcast-qual
-Wmissing-declarations
-Wmissing-prototypes
-Wpointer-arith
-Wshadow
-Wstrict-prototypes
-Wwrite-strings
- Raw text -