Recommended GCC warning options for C

c, compiler-errors, gcc

Solution

I routinely use:

gcc -m64 -std=c99 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual \
    -Wstrict-prototypes -Wmissing-prototypes

This set catches a lot for people unused to it (people whose code I get to compile with those flags for the first time); it seldom gives me a problem (though -Wcast-qual is occasionally a nuisance).

Problem

Other than -Wall, what other warnings have people found useful? Options to Request or Suppress Warnings

Original source

Related problems