Naming conventions for compiler options [Was: layout rule infelicity]

oleg@pobox.com oleg@pobox.com
Thu, 30 May 2002 16:51:58 -0700 (PDT)


[redirected to haskell-cafe]

Jón Fairbairn wrote:
> 1. Why "-f" anyway? It took me ages to work out what
> "-fallow-overlapping-instances" meant -- I wondered how
> "fallow" could apply to overlapping instances.

I believe the authors of GHC followed the naming conventions
of GCC, which can be gleaned from GCC's info page.

  -warning-related options typically start with -W
  -machine-independent flags that control optimization,
   code-generation or language dialects start with -f.
   Most flags have positive and negative forms.
  -many pre-processor-related options start with -i
  -hardware-dependent options start with -m, e.g.,
   -mcpu=i686 -mno-fancy-math-387 -malign-int
   -mno-power [RS/6000-related option]
   -myellowknife [On embedded PowerPC systems, assume that the startup
                  module is called `crt0.o' and the standard C
                  libraries are `libyk.a' and `libc.a']

Of possible interest is a file
	gcc-2.95.2/gcc/future.options
from GCC's source code. The file lists a few suggested options. The
file is an e-mail message from Noah Friedman to Richard Stallman, Jim
Blandy and a few other people. Some of the suggested options are:

-Waggravate-return
-Wcast-spell
-Wcaste-align              [cf. the existing GCC option -Wcast-align]
-Win                       [I guess warn about the Windows system]
-Wmissing-protons
-Wredundant-repetitions
-antsy
-fbungee-jump
-fexpensive-operations     [cf. -fexpensive-optimizations]
-fextra-strength           [must be a negative form of -fstrength-reduce]     
-fkeep-programmers-inline  [cf. the existing option -fkeep-inline-functions]
-fjesus-saves              [cf. the existing option -fcaller-saves]
-fno-peeping-toms          [cf. the existing option -fno-peephole]
-fruit-roll-ups            [cf. the existing option -funroll-loops]
-fshort-enough
-mno-dialogue
-vomit-frame-pointer