GMQCC

An Improved Quake C Compiler

Defaults Flag

The -show-defaults flag instructs the compiler to print out the defaults used related to the standard, optimization, and code generation. When this flag is specified, the compiler will just print the defaults and quit. No compilation is performed.

$ gmqcc -show-defaults

Compiling for an alternitive standard

To compile with a different dialect of the QuakeC programming language the -std flag can be instructed to select one of the following options:
gmqcc default standard
fteqcc fteqcc standard
qcc vanila QuakeC standard

Common compiler options

Options What it does
-l<path> Adds <path> to the directories searched by the preprocessor for include file resolution.
-o <file> Generates the named executable (progs.src) file (when not specified default is progs.src).
-O<level> Specfies the optimization level: highest being 3, lowest being 0 (no optimization).
-E Instructs the compiler to only preprocess the input, writing the preprocessed output to stdout
-Wall Enables all compiled warnings for the selcted standard
-Werror Instruct the compiler to treat all warnings as errors
-std=<standard> Selects the standard dialect

Predefined Macros

Macro What it represents
GMQCC Specifies the current selected standard is gmqcc.
FTEQCC Specifies the current selected standard is fteqcc.
QCC Specifies the current selected standard is qcc.
__STD_VERSION_MINOR__ Specifies the current selected stanadards minor version number.
__STD_VERSION_MAJOR__ Specifies the current selected stanadards major version number.

Unsupported compatability options

GMQCC strives hard for compatability with standard dialects, but not all features of those standards might be implemented. The unsupported features are presented below:

Feature Standard
Inline Assembly FTEQCC
Macro expansion in strings FTEQCC

Less common compiler options

Code generation options

Option What it does
-foverlap-locals Reduces codesize by overlapping locals where possible
-fdarkplaces-string-table-bug Works around a bug in older Darkplaces engine builds where the stringtable size is computed wrong
-fadjust-vector-fields corrects assignment of vector field pointers (STORE_V instead of STORE_FLD)
-fftepp Enables FTEQ preprocessor
-frelaxted-switch Relaxes switch statement semantics
-fshort-logic Enables short circut evaluation/logic
-fperl-logic Enables perl evalutaion/logic

Warning options

Option What it does
-Wunused-uninitialized Enables warnings about unused or uninitialized variables
-Wunknwon-control-sequence Enables warnings about unknown control sequences
-Wextension Enables warnings about the use of (an) extension(s)
-Wfield-redeclared Enables warnings about redeclared fields
-Wmissing-return-values Enables warnings about missing return values
-Wtoo-few-paramaters Enables warnings about missing paramaters for function calls
-Wlocal-shadows Enables warnings about locals shadowing paramaters or other locals
-Wlocal-constants Enables warnings about constants specified as locals
-Wvoid-variables Enables warnings about variables declared as type void
-Wimplicit-function-pointer Enables warnings about implicitly declared function pointers
-Wvariadic-function Enables warnings for use of varadics for non-builtin functions
-Wframe-macros Enables warnings about duplicated frame macros
-Weffectless-statement Enables warnings about effectiveless statements
-Wend-sys-field Enables warnings of end_sys_fields being declared a field
-Wassign-function-types Enables warnings for incompatible function pointer signatures used in assignment
-Wpreprocessor Enables warnings about redefined macros
-Wmultifile-if Enables warnings about multifile if statements

Individual warnings may be disabled with  -Wno<warning>

$ gmqcc -Wno-frame-macros # disables frame duplication warning

Miscellaneous options

Option What it does
-force-crc=<num> Forces a specific checsum into the header
-debug Turns on compiler debug messages
-memchk Turns on compiler memory leak checker
-Whelp or -W? Lists all warning options
-fhelp or -f? Liss all code generation options

Support or Contact

Having trouble with GMQCC? Join our IRC channel at #kf-engine on irc.freenode.net or contact Us