Software Development under LinuxUse of gcc/g++Important gcc Flags

2.1. Important gcc Flags

-ansiThis flag tells the compiler to enforce ANSI C standards
-pedanticMore pedantic ansi, warnings for stuff you probably didn't mean.
-WallShow all reasonable warnings (there are more).
-gProduce debug information, necessary for debugging.
-llibraryLinks to a standard library. Use -lm to load the standard maths library.
-cCompile or assemble the source files, but do not link. The compiler output is object files corresponding to each source file.
-SCompile only; output assembly code.
-EPre-process only. Output pre-processed code.
-DmacroDefine 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.

Written by Shlomi Fish