Compiler flags

Gcc is the standard c compiler used for OrangeFS. The general use of gcc is beyond the scope of this document, but there are a few guidelines that should be followed when building software with gcc:

  • Always use the -Wall command line flag to gcc. This turns on most of the warnings that gcc is capable of generating at compile time. The warnings tend to point out bad coding habits and ambiguous statements. Use the -Wall option from the very beginning of your project- it is often overwhelming to try to apply it after the code base has gotten large because of the sheer number of warnings that it will probably find at that point.
  • Always use the -Wstrict-prototypes command line flag to gcc. This turns on additional warnings that enforce the use of proper prototypes for all functions. See section \ref{sec:proto} for more information.
  • Make use of the -g option to gcc in development code. This enables debugging symbols for use with gdb (section \ref{sec:gdb}). When code is released to the public, it may be the case that this option will be removed in order to reduce binary size or increase optimization, but it is invaluable during the development cycle.

 Back to Developer Guidelines

Back to OrangeFS Main Page