Important gcc Flags

Contents | Up | Prev | Next

# 3.1. Important gcc Flags

`-ansi` | This flag tells the compiler to enforce ANSI C standards
`-pedantic` | More pedantic ansi, warnings for stuff you probably didn't mean.
`-Wall` | Show all reasonable warnings (there are more).
`-g` | Produce debug information, necessary for debugging.
`-llibrary` | Links to a standard library. Use `-lm` to load the standard math library.
`-c` | Compile or assemble the source files, but do not link. The compiler output is object files corresponding to each source file.
`-S` | Compile only; output assembly code.
`-E` | Pre-process only. Output pre-processed code.
`-Dmacro` | Define a macro, one can also use `-Dmacro=val` in order to assign a value for the macro. This will be used for preprocessing all files.

- When compiling, I recommend (and Kimchi demands) compiling with:
  `gcc -ansi -pedantic -Wall file1 [file2 [file3...]] -o output`

Contents | Up | Prev | Next