In general I enable all warnings and then remove those flags selectively that give useless outputs. In one of my projects, I use the following C and C++ warnings:
-pedantic
-Wall
-Wextra
-Wformat=2
-Wmissing-include-dirs
-Wswitch-default
-Wswitch-enum
-Wunused
-Wstrict-aliasing=1
-Wfloat-equal
-Wundef
-Wunsafe-loop-optimizations
-Wpointer-arith
-Wcast-qual
-Wcast-align
-Wwrite-strings
-Wconversion
-Wmissing-format-attribute
-Wpacked
-Wredundant-decls
-Winvalid-pch
-Wvolatile-register-var
-Wsync-nand
-Wsign-conversion
-Wlogical-op
-Wmissing-declarations
-Wmissing-noreturn
-Wstrict-overflow=5
-Wstack-protector
In addition, I use the following C++ flags:
-std=c++98
-Wnon-virtual-dtor
-Wctor-dtor-privacy
-Wstrict-null-sentinel
-Woverloaded-virtual
-Wsign-promo
In addition, for the release build I enable the following warnings:
-pedantic-errors
-Werror
-Wuninitialized
-Winit-self
-Wdisabled-optimization
I find it quite annoying that -Wall
enables only the absolute minimum of warnings instead of "all", as the name implies.