I'm working through a Gentoo installation. I'm at Chapter 7 and 'emerge gentoo-sources' (almost there). I see -Wall and -Wextra are being used (sample below). That's awesome - I don't ever recall seeing it in the free software world. Hats off to the folks responsible for getting the option added. CCCMD = x86_64-pc-linux-gnu-gcc -DPERL_CORE -c -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 -O2 -pipe -Wall -ansi -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat `sh cflags "optimize='-O2 -pipe'" reentr.o` -fPIC reentr.c I noticed a couple of interesting options are not present that might be useful: -Wconversion, and -fstrict-overflow -Wstrict-overflow. I don't believe they are part of -Wall and -Wextra. I like to use the above flags to catch problems lurking in the background, such as truncation and extension problems, and code removed due to optimizations. They are especially important on a 64-bit machine, where the developer only used a 32-bit machine for dev/qa.
$ uname -a Linux Gentoo-2012 3.3.0-gentoo-r1 #1 SMP Fri Mar 30 06:21:40 UTC 2012 x86_64 Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz GenuineIntel GNU/Linux Inside a VM om Mac OS X.
We didn't add these. They are upstream defaults. We strive to add ours (CFLAGS and so on) after the upstream ones to allow Gentoo users more control over them. We also strive to remove upstream CFLAGS that might clash with our CFLAGS (or lack thereof), like overzealous optimisation and architecture specific options. You can add the compiler flags you like to the CFLAGS variable in your own make.conf, though.
(In reply to comment #2) > We didn't add these. They are upstream defaults. In the example you presented, they are from dev-lang/perl. :)