An Improved Quake C Compiler
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
gmqcc | default standard |
fteqcc | fteqcc standard |
qcc | vanila QuakeC standard |
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 |
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. |
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 |
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 |
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
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? | Lists all code generation options |
To compile GMQCC on BSD/NIX the following things are required:
$ git clone git://github.com/graphitemaster/gmqcc.git $ cd gmqccThe Makefile contains a few rules, depending on what you want to compile, the following rules are:
Rule | What it does |
gmqcc | Builds the gmqcc compiler |
qcvm | Builds a standable QuakeC VM |
testsuite | Builds the testsuite for GMQCC |
all | Builds gmqcc, qcvm, and testsuite |
install | Installs gmqcc to /usr/local/ |
check | Runs the testsuite to verify correctness |
To compile GMQCC on windows the following things are required:
Once obtained you may checkout the development repository with the following msysGit commands from a msysGit shell.$ git clone git://github.com/graphitemaster/gmqcc.gitIncluded is a VS project file.
GMQCC comes with a complete testsuite system for verifying semantics and syntatics, TODO explain more and how to use it, write your own tests etc....
Having trouble with GMQCC? Join our IRC channel at #kf-engine on irc.freenode.net or contact Us