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 (not optimization).
-E Instructs the compiler to only preprocess the input, writing the preprocessed source 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
__STD_GMQCC__ Specifies the current selected standard is gmqcc.
__STD_FTEQCC__ Specifies the current selected standard is fteqcc.
__STD_QCC__ Specifies the current selected standard is qcc.

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

Support or Contact

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