| Most of these are clang specific but I tend to do something like -pipe -std=c++11 -gfull # generate correct debugging symbols for dead code stripping -stdlib=libc++ -Ofast # fast, aggressive optimizations (clang-specific) -fvectorize # enable loop autovectorizer -fdiagnostics-show-template-tree (clang: print C++ template error as a tree instead of on a single line) -Weverything # clang specific: enable every single warning -Werror -Wfatal-errors # die after the first error encountered -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-global-constructors -Wno-exit-time-destructors -ffast-math # enable some floating point optimizations that
break IEEE754 compliance but usually work -funroll-loops # enable loop unrolling -fstrict-aliasing # make more aggressive assumptions about whether pointers can point to the same objects -fatal_warnings # treat linker warnings as fatal -flto # enable link-time optimization -dead_strip # enable dead code stripping -Wno-error=deprecated # like being able to put __attribute((deprecated)) in code as a note to self -Wno-error=#warnings # same thing goes for #warnings |