gmqcc/doc.html

376 lines
17 KiB
HTML
Raw Normal View History

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>GMQCC by graphitemaster</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
<script src="javascripts/scale.fix.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<a href="https://github.com/graphitemaster/gmqcc"><div class="fork"></div></a>
<div class="wrapper">
<header>
<h1 class="header">GMQCC</h1>
<p class="header">An Improved Quake C Compiler</p>
<ul>
<li class="download"><a href="https://github.com/graphitemaster/gmqcc/zipball/master">Download ZIP</a></li>
<li class="download"><a href="https://github.com/graphitemaster/gmqcc/tarball/master">Download TAR</a></li>
<li class="buttons"><a href="https://github.com/graphitemaster/gmqcc/issues">Issues</a></li>
<li class="buttons"><a href="doc.html">Documentation</a></li>
<li class="buttons"><a href="https://github.com/graphitemaster/gmqcc">View On GitHub</a></li>
</ul>
</header>
<section>
2012-11-24 01:46:48 +00:00
<ul class="wiki">
<li class="wiki"><a class="wiki" href="#cdoc">Compiler Documentation</a></li>
<li class="wiki"><a class="wiki" href="#bdoc">Building Documentation</a></li>
<li class="wiki"><a class="wiki" href="#tdoc">Testsuite Documentation</a></li>
</ul>
<h1><a name="cdoc">Compiler Documentation</a></h1>
<h3>Defaults Flag</h3>
<p>
The <i>-show-defaults</i> 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.
</p>
2012-11-23 21:46:39 +00:00
<pre>$ gmqcc -show-defaults</pre>
2012-11-24 01:46:48 +00:00
<h3>Compiling for an alternitive standard</h3>
To compile with a different dialect of the QuakeC programming language the <i>-std</i>
flag can be instructed to select one of the following options:
<table border="0">
<tr>
<td>gmqcc</td>
<td>default standard</td>
</tr>
<tr>
<td>fteqcc</td>
<td>fteqcc standard</td>
</tr>
<tr>
<td>qcc</td>
<td>vanila QuakeC standard</td>
</tr>
</table>
<h2>Common compiler options</h2>
<table border="0">
<tr>
<td>Options</td>
<td>What it does</td>
</tr>
<tr>
<td>-l&lt;path&gt;</td>
<td>Adds &lt;path&gt; to the directories searched by the preprocessor for include file resolution.</td>
</tr>
<tr>
<td>-o &lt;file&gt;</td>
<td>Generates the named executable (progs.src) file (when not specified default is progs.src).</td>
</tr>
<tr>
<td>-O&lt;level&gt;</td>
2012-11-23 21:48:02 +00:00
<td>Specfies the optimization level: highest being 3, lowest being 0 (no optimization).</td>
</tr>
<tr>
<td>-E</td>
2012-11-23 21:48:31 +00:00
<td>Instructs the compiler to only preprocess the input, writing the preprocessed output to stdout</td>
</tr>
<tr>
<td>-Wall</td>
<td>Enables all compiled warnings for the selcted standard</td>
</tr>
<tr>
<td>-Werror</td>
<td>Instruct the compiler to treat all warnings as errors</td>
</tr>
<tr>
<td>-std=&lt;standard&gt;</td>
<td>Selects the standard dialect</td>
</tr>
</table>
2012-11-24 01:46:48 +00:00
<h3>Predefined Macros</h3>
<table border="0">
<tr>
<td>Macro</td>
<td>What it represents</td>
</tr>
<tr>
2012-11-23 22:04:30 +00:00
<td>GMQCC</td>
<td>Specifies the current selected standard is gmqcc.</td>
</tr>
<tr>
2012-11-23 22:04:30 +00:00
<td>FTEQCC</td>
<td>Specifies the current selected standard is fteqcc.</td>
</tr>
<tr>
2012-11-23 22:04:30 +00:00
<td>QCC</td>
<td>Specifies the current selected standard is qcc.</td>
</tr>
<tr>
<td>__STD_VERSION_MINOR__</td>
<td>Specifies the current selected stanadards minor version number.</td>
</tr>
<tr>
<td>__STD_VERSION_MAJOR__</td>
<td>Specifies the current selected stanadards major version number.</td>
</tr>
</table>
2012-11-24 01:46:48 +00:00
<h3>Unsupported compatability options</h3>
<p>
GMQCC strives hard for compatability with standard dialects, but not all
features of those standards might be implemented. The unsupported features
are presented below:
<table border="0">
<tr>
<td>Feature</td>
<td>Standard</td>
</tr>
<tr>
<td>Inline Assembly</td>
<td>FTEQCC</td>
</tr>
<tr>
<td>Macro expansion in strings</td>
<td>FTEQCC</td>
</tr>
</table>
</p>
2012-11-24 01:46:48 +00:00
<h2>Less common compiler options</h2>
<h3>Code generation options</h3>
<table border="0">
<tr>
<td>Option</td>
<td>What it does</td>
</tr>
<tr>
<td>-foverlap-locals</td>
<td>Reduces codesize by overlapping locals where possible</td>
</tr>
<tr>
<td>-fdarkplaces-string-table-bug</td>
<td>Works around a bug in older Darkplaces engine builds where the stringtable size is computed wrong</td>
</tr>
<tr>
<td>-fadjust-vector-fields</td>
<td>corrects assignment of vector field pointers (STORE_V instead of STORE_FLD)</td>
</tr>
<tr>
<td>-fftepp</td>
<td>Enables FTEQ preprocessor</td>
</tr>
<tr>
<td>-frelaxted-switch</td>
<td>Relaxes switch statement semantics</td>
</tr>
<tr>
<td>-fshort-logic</td>
<td>Enables short circut evaluation/logic</td>
</tr>
<tr>
<td>-fperl-logic</td>
2012-11-23 21:45:42 +00:00
<td>Enables perl evalutaion/logic</td>
</tr>
</table>
2012-11-24 01:46:48 +00:00
<h3>Warning options</h3>
<table border="0">
<tr>
<td>Option</td>
<td>What it does</td>
</tr>
<tr>
<td>-Wunused-uninitialized</td>
<td>Enables warnings about unused or uninitialized variables</td>
</tr>
<tr>
<td>-Wunknwon-control-sequence</td>
2012-11-23 21:45:42 +00:00
<td>Enables warnings about unknown control sequences</td>
</tr>
<tr>
<td>-Wextension</td>
<td>Enables warnings about the use of (an) extension(s)</td>
</tr>
<tr>
<td>-Wfield-redeclared</td>
<td>Enables warnings about redeclared fields</td>
</tr>
<tr>
<td>-Wmissing-return-values</td>
<td>Enables warnings about missing return values</td>
</tr>
<tr>
<td>-Wtoo-few-paramaters</td>
<td>Enables warnings about missing paramaters for function calls</td>
</tr>
<tr>
<td>-Wlocal-shadows</td>
<td>Enables warnings about locals shadowing paramaters or other locals</td>
</tr>
<tr>
<td>-Wlocal-constants</td>
<td>Enables warnings about constants specified as locals</td>
</tr>
<tr>
<td>-Wvoid-variables</td>
<td>Enables warnings about variables declared as type void</td>
</tr>
<tr>
<td>-Wimplicit-function-pointer</td>
<td>Enables warnings about implicitly declared function pointers</td>
</tr>
<tr>
<td>-Wvariadic-function</td>
<td>Enables warnings for use of varadics for non-builtin functions</td>
</tr>
<tr>
<td>-Wframe-macros</td>
<td>Enables warnings about duplicated frame macros</td>
</tr>
<tr>
<td>-Weffectless-statement</td>
<td>Enables warnings about effectiveless statements</td>
</tr>
<tr>
<td>-Wend-sys-field</td>
<td>Enables warnings of end_sys_fields being declared a field</td>
</tr>
<tr>
<td>-Wassign-function-types</td>
<td>Enables warnings for incompatible function pointer signatures used in assignment</td>
</tr>
<tr>
<td>-Wpreprocessor</td>
<td>Enables warnings about redefined macros</td>
</tr>
<tr>
<td>-Wmultifile-if</td>
<td>Enables warnings about multifile if statements</td>
</tr>
</table>
<p>
Individual warnings may be disabled with &nbsp;-Wno&lt;warning&gt;
<pre>$ gmqcc -Wno-frame-macros # disables frame duplication warning</pre>
</p>
2012-11-24 01:46:48 +00:00
<h3>Miscellaneous options</h3>
<table border="0">
<tr>
<td>Option</td>
<td>What it does</td>
</tr>
<tr>
<td>-force-crc=&lt;num&gt;</td>
<td>Forces a specific checsum into the header</td>
</tr>
<tr>
<td>-debug</td>
<td>Turns on compiler debug messages</td>
</tr>
<tr>
<td>-memchk</td>
<td>Turns on compiler memory leak checker</td>
</tr>
2012-11-23 22:04:30 +00:00
<tr>
<td>-Whelp or -W?</td>
<td>Lists all warning options</td>
</tr>
<tr>
<td>-fhelp or -f?</td>
2012-11-23 22:04:54 +00:00
<td>Lists all code generation options</td>
2012-11-23 22:04:30 +00:00
</tr>
</table>
2012-11-24 01:46:48 +00:00
<h1><a name="bdoc">Building Documentation</a></h1>
<h2>Building on BSD/NIX</h2>
<p>
To compile GMQCC on BSD/NIX the following things are
required:
<ul>
<li>GIT</li>
<li>Make</li>
<li>Any C90+ C compiler</li>
</ul>
Once obtained you may checkout the development repository
with the following shell commands
<pre>$ git clone git://github.com/graphitemaster/gmqcc.git
$ cd gmqcc
</pre>
The Makefile contains a few rules, depending on what you
want to compile, the following rules are:
<table border="0">
<tr>
<td>Rule</td>
<td>What it does</td>
</tr>
<tr>
<td>gmqcc</td>
<td>Builds the gmqcc compiler</td>
</tr>
<tr>
<td>qcvm</td>
<td>Builds a standable QuakeC VM</td>
</tr>
<tr>
<td>testsuite</td>
<td>Builds the testsuite for GMQCC</td>
</tr>
<tr>
<td>all</td>
<td>Builds gmqcc, qcvm, and testsuite</td>
</tr>
<tr>
<td>install</td>
<td>Installs gmqcc to /usr/local/</td>
</tr>
<tr>
<td>check</td>
<td>Runs the testsuite to verify correctness</td>
</tr>
</table>
</p>
<h2>Building on Windows</h2>
<p>
To compile GMQCC on windows the following things are
required:
<ul>
<li><a href="http://msysgit.googlecode.com/files/Git-1.8.0-preview20121022.exe">msysGit</a></li>
<li><a href="http://www.microsoft.com/visualstudio/eng/downloads">Visual Studio</a></li>
</ul>
Once obtained you may checkout the development repository
with the following msysGit commands from a msysGit shell.
<pre>$ git clone git://github.com/graphitemaster/gmqcc.git</pre>
Included is a VS project file.
</p>
<h1><a name="tdoc">Testsuite Documentation</a></h1>
<p>
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....
</p>
<h3>Support or Contact</h3>
<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>
</section>
<footer>
<script type="text/javascript" src="http://www.ohloh.net/p/602517/widgets/project_partner_badge.js"></script>
</footer>
</div>
<!--[if !IE]><script>fixScale(document);</script><![endif]-->
</body>
</html>