5 <meta http-equiv="X-UA-Compatible" content="chrome=1">
6 <title>GMQCC by graphitemaster</title>
8 <link rel="stylesheet" href="stylesheets/styles.css">
9 <link rel="stylesheet" href="stylesheets/pygment_trac.css">
10 <script src="javascripts/scale.fix.js"></script>
11 <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
13 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
17 <a href="https://github.com/graphitemaster/gmqcc"><div class="fork"></div></a>
20 <h1 class="header">GMQCC</h1>
21 <p class="header">An Improved Quake C Compiler</p>
23 <li class="download"><a href="https://github.com/graphitemaster/gmqcc/zipball/master">Download ZIP</a></li>
24 <li class="download"><a href="https://github.com/graphitemaster/gmqcc/tarball/master">Download TAR</a></li>
25 <li class="buttons"><a href="https://github.com/graphitemaster/gmqcc/issues">Issues</a></li>
26 <li class="buttons"><a href="doc.html">Documentation</a></li>
27 <li class="buttons"><a href="https://github.com/graphitemaster/gmqcc">View On GitHub</a></li>
32 <li class="wiki"><a class="wiki" href="#cdoc">Compiler Documentation</a></li>
33 <li class="wiki"><a class="wiki" href="#bdoc">Building Documentation</a></li>
34 <li class="wiki"><a class="wiki" href="#tdoc">Testsuite Documentation</a></li>
36 <h1><a name="cdoc">Compiler Documentation</a></h1>
37 <h3>Defaults Flag</h3>
39 The <i>-show-defaults</i> flag instructs the compiler to print out the defaults used related to
40 the standard, optimization, and code generation. When this flag is specified, the compiler
41 will just print the defaults and quit. No compilation is performed.
43 <pre>$ gmqcc -show-defaults</pre>
44 <h3>Compiling for an alternitive standard</h3>
45 To compile with a different dialect of the QuakeC programming language the <i>-std</i>
46 flag can be instructed to select one of the following options:
50 <td>default standard</td>
54 <td>fteqcc standard</td>
58 <td>vanila QuakeC standard</td>
61 <h2>Common compiler options</h2>
68 <td>-l<path></td>
69 <td>Adds <path> to the directories searched by the preprocessor for include file resolution.</td>
72 <td>-o <file></td>
73 <td>Generates the named executable (progs.src) file (when not specified default is progs.src).</td>
77 <td>-O<level></td>
78 <td>Specfies the optimization level: highest being 3, lowest being 0 (no optimization).</td>
82 <td>Instructs the compiler to only preprocess the input, writing the preprocessed output to stdout</td>
86 <td>Enables all compiled warnings for the selcted standard</td>
90 <td>Instruct the compiler to treat all warnings as errors</td>
93 <td>-std=<standard></td>
94 <td>Selects the standard dialect</td>
97 <h3>Predefined Macros</h3>
101 <td>What it represents</td>
105 <td>Specifies the current selected standard is gmqcc.</td>
109 <td>Specifies the current selected standard is fteqcc.</td>
113 <td>Specifies the current selected standard is qcc.</td>
117 <td>__STD_VERSION_MINOR__</td>
118 <td>Specifies the current selected stanadards minor version number.</td>
121 <td>__STD_VERSION_MAJOR__</td>
122 <td>Specifies the current selected stanadards major version number.</td>
125 <h3>Unsupported compatability options</h3>
127 GMQCC strives hard for compatability with standard dialects, but not all
128 features of those standards might be implemented. The unsupported features
136 <td>Inline Assembly</td>
140 <td>Macro expansion in strings</td>
145 <h2>Less common compiler options</h2>
146 <h3>Code generation options</h3>
150 <td>What it does</td>
153 <td>-foverlap-locals</td>
154 <td>Reduces codesize by overlapping locals where possible</td>
157 <td>-fdarkplaces-string-table-bug</td>
158 <td>Works around a bug in older Darkplaces engine builds where the stringtable size is computed wrong</td>
161 <td>-fadjust-vector-fields</td>
162 <td>corrects assignment of vector field pointers (STORE_V instead of STORE_FLD)</td>
166 <td>Enables FTEQ preprocessor</td>
169 <td>-frelaxted-switch</td>
170 <td>Relaxes switch statement semantics</td>
173 <td>-fshort-logic</td>
174 <td>Enables short circut evaluation/logic</td>
177 <td>-fperl-logic</td>
178 <td>Enables perl evalutaion/logic</td>
181 <h3>Warning options</h3>
185 <td>What it does</td>
188 <td>-Wunused-uninitialized</td>
189 <td>Enables warnings about unused or uninitialized variables</td>
192 <td>-Wunknwon-control-sequence</td>
193 <td>Enables warnings about unknown control sequences</td>
197 <td>Enables warnings about the use of (an) extension(s)</td>
200 <td>-Wfield-redeclared</td>
201 <td>Enables warnings about redeclared fields</td>
204 <td>-Wmissing-return-values</td>
205 <td>Enables warnings about missing return values</td>
208 <td>-Wtoo-few-paramaters</td>
209 <td>Enables warnings about missing paramaters for function calls</td>
212 <td>-Wlocal-shadows</td>
213 <td>Enables warnings about locals shadowing paramaters or other locals</td>
216 <td>-Wlocal-constants</td>
217 <td>Enables warnings about constants specified as locals</td>
220 <td>-Wvoid-variables</td>
221 <td>Enables warnings about variables declared as type void</td>
224 <td>-Wimplicit-function-pointer</td>
225 <td>Enables warnings about implicitly declared function pointers</td>
228 <td>-Wvariadic-function</td>
229 <td>Enables warnings for use of varadics for non-builtin functions</td>
232 <td>-Wframe-macros</td>
233 <td>Enables warnings about duplicated frame macros</td>
236 <td>-Weffectless-statement</td>
237 <td>Enables warnings about effectiveless statements</td>
240 <td>-Wend-sys-field</td>
241 <td>Enables warnings of end_sys_fields being declared a field</td>
244 <td>-Wassign-function-types</td>
245 <td>Enables warnings for incompatible function pointer signatures used in assignment</td>
248 <td>-Wpreprocessor</td>
249 <td>Enables warnings about redefined macros</td>
252 <td>-Wmultifile-if</td>
253 <td>Enables warnings about multifile if statements</td>
257 Individual warnings may be disabled with -Wno<warning>
258 <pre>$ gmqcc -Wno-frame-macros # disables frame duplication warning</pre>
260 <h3>Miscellaneous options</h3>
264 <td>What it does</td>
267 <td>-force-crc=<num></td>
268 <td>Forces a specific checsum into the header</td>
272 <td>Turns on compiler debug messages</td>
276 <td>Turns on compiler memory leak checker</td>
280 <td>-Whelp or -W?</td>
281 <td>Lists all warning options</td>
285 <td>-fhelp or -f?</td>
286 <td>Lists all code generation options</td>
290 <h1><a name="bdoc">Building Documentation</a></h1>
291 <h2>Building on BSD/NIX</h2>
293 To compile GMQCC on BSD/NIX the following things are
299 <li>Any C90+ C compiler</li>
302 Once obtained you may checkout the development repository
303 with the following shell commands
305 <pre>$ git clone git://github.com/graphitemaster/gmqcc.git
309 The Makefile contains a few rules, depending on what you
310 want to compile, the following rules are:
315 <td>What it does</td>
319 <td>Builds the gmqcc compiler</td>
323 <td>Builds a standable QuakeC VM</td>
327 <td>Builds the testsuite for GMQCC</td>
331 <td>Builds gmqcc, qcvm, and testsuite</td>
335 <td>Installs gmqcc to /usr/local/</td>
339 <td>Runs the testsuite to verify correctness</td>
343 <h2>Building on Windows</h2>
345 To compile GMQCC on windows the following things are
349 <li><a href="http://msysgit.googlecode.com/files/Git-1.8.0-preview20121022.exe">msysGit</a></li>
350 <li><a href="http://www.microsoft.com/visualstudio/eng/downloads">Visual Studio</a></li>
353 Once obtained you may checkout the development repository
354 with the following msysGit commands from a msysGit shell.
355 <pre>$ git clone git://github.com/graphitemaster/gmqcc.git</pre>
356 Included is a VS project file.
359 <h1><a name="tdoc">Testsuite Documentation</a></h1>
361 GMQCC comes with a complete testsuite system for verifying semantics
362 and syntatics, TODO explain more and how to use it, write your own
366 <h3>Support or Contact</h3>
367 <p>Having trouble with GMQCC? Join our IRC channel at #kf-engine on irc.freenode.net or contact <a href="mailto:cube2killfild@gmail.com">Us</a>
370 <script type="text/javascript" src="http://www.ohloh.net/p/602517/widgets/project_partner_badge.js"></script>
373 <!--[if !IE]><script>fixScale(document);</script><![endif]-->