

Personally I wouldn't go for less than -Wall -Wextra -Wfloat-equal -Wundef -Wcast-align -Wwrite-strings -Wlogical-op -Wmissing-declarations -Wredundant-decls -Wshadow -Woverloaded-virtual. While -Wall -Wextra is better, it's still not making use of all the error checking your compiler can do for you. It does mean a set of individual options that is bound to change.īottom line, it is about the absolute minimum of warnings you should set.It does also not mean "(almost) all", not by a long shot.Some of them are enabled by -Wextraīut many of them must be enabled individually. Occasionally you might wish to check for others warn about constructions thatĪre necessary or hard to avoid in some cases, and there is no simple way to Some of them warnĪbout constructions that users generally do not consider questionable, but which Note that some warning flags are not implied by -Wall. Questionable, and that are easy to avoid (or modify to prevent the warning), This enables all the warnings about constructions that some users consider

Sadly enough none of the answers is quoting the actually relevant part of manual, which really brings it to a point: Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wjump-misses-init -Wlogical-op -Werror=missing-braces -Wmissing-declarations -Wno-missing-format-attribute -Wmissing-include-dirs -Wmultichar -Wpacked -Wpointer-arith -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Werror=undef -Wno-unused -Wvariadic-macros -Wwrite-strings -Wc++-compat -Werror=declaration-after-statement -Werror=implicit-function-declaration -Wmissing-prototypes -Werror=nested-externs -Werror=old-style-definition -Werror=strict-prototypes There are many more warnings which you have to turn on explicitly. Or -Wall) -Wunused-but-set-parameter (only with -Wunused or -Wall) Wsign-compare -Wtype-limits -Wuninitialized -Wunused-parameter (only with -Wunused Wmissing-parameter-type (C only) -Wold-style-declaration (C only) -Woverride-init Wextra contains: -Wclobbered -Wempty-body -Wignored-qualifiers -Wmissing-field-initializers

Wunused-function -Wunused-label -Wunused-value -Wunused-variable Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wuninitialized -Wunknown-pragmas Wsequence-point -Wsign-compare (only in C++) -Wstrict-aliasing Wmissing-braces -Wnonnull -Wparentheses -Wpointer-sign -Wreorder -Wreturn-type Wcomment -Wformat -Wmain (only for C/ObjC and unless -ffreestanding) Objective-C only) -Wimplicit-function-declaration (C and Objective-C only) Wenum-compare (in C/Objc this is on by default in C++) -Wimplicit-int (C and Wall turns on these warnings: -Waddress -Warray-bounds (only with -O2) -Wc++0x-compat -Wchar-subscripts
