title: Making GCC and other C++ compilers very strict
body: <p>I'm working on a large collaborative C++ project that is both developed and run on various flavors of Linux, OS X and Windows. We compile across these platforms with GCC, Visual Studio C++ and the Intel C++ compiler. As more and more people start developing code for the project, we're starting to see weird errors in compilation and runtime that are specific to particular compilers on particular operating systems. An example of this is implicit inclusion of headers that certain OS/compiler pairs seem to find for you, accidentally overloading a function from a base class in a derived class.</p>
  <p>My goal is to make compilation on GCC more strict and catch more errors across all platforms so that we don't keep running into these problems. Here's my list of flags that I'm thinking about trying out for GCC that I've found via Google and the GCC man pages:</p>
  <ul>
  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wall" rel="nofollow noreferrer">-Wall</a></li>
  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wextra" rel="nofollow noreferrer">-Wextra</a></li>
  <li>-Winit-self</li>
  <li>-Wold-style-cast</li>
  <li>-Woverloaded-virtual</li>
  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wuninitialized" rel="nofollow noreferrer">-Wuninitialized</a></li>
  <li>-Wmissing-declarations</li>
  <li>-Winit-self</li>
  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-ANSI-support" rel="nofollow noreferrer">-ansi</a></li>
  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-pedantic-1" rel="nofollow noreferrer">-pedantic</a></li>
  </ul>
  <p>What are the other flags that people use to make GCC (and less importantly Visual Studio C++ and the Intel C++ Compiler) obey a stricter standard of the C++ language? Be specific about which compiler and version you're talking about, as some of these might not be implemented in all versions of all compilers.</p>