]> git.xonotic.org Git - xonotic/gmqcc.git/blob - doc.html
typo
[xonotic/gmqcc.git] / doc.html
1 <!doctype html>
2 <html>
3     <head>
4         <meta charset="utf-8">
5         <meta http-equiv="X-UA-Compatible" content="chrome=1">
6         <title>GMQCC by graphitemaster</title>
7
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">
12         <!--[if lt IE 9]>
13         <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
14         <![endif]-->
15     </head>
16     <body>
17         <a href="https://github.com/graphitemaster/gmqcc"><div class="fork"></div></a>
18         <div class="wrapper">
19             <header>
20                 <h1 class="header">GMQCC</h1>
21                 <p class="header">An Improved Quake C Compiler</p>
22                 <ul>
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>
28                 </ul>
29             </header>
30             <section>
31                 <h2>Defaults Flag</h2>
32                 <p>
33                     The <i>-show-defaults</i> flag instructs the compiler to print out the defaults used related to
34                     the standard, optimization, and code generation.  When this flag is specified, the compiler
35                     will just print the defaults and quit.  No compilation is performed.
36                 </p>
37                 <pre>$ gmqcc -show-defaults</pre>
38                 <h2>Compiling for an alternitive standard</h2>
39                 To compile with a different dialect of the QuakeC programming language the <i>-std</i>
40                 flag can be instructed to select one of the following options:
41                 <table border="0">
42                     <tr>
43                         <td>gmqcc</td>
44                         <td>default standard</td>
45                     </tr>
46                     <tr>
47                         <td>fteqcc</td>
48                         <td>fteqcc standard</td>
49                     </tr>
50                     <tr>
51                         <td>qcc</td>
52                         <td>vanila QuakeC standard</td>
53                     </tr>
54                 </table>
55                 <h2>Common compiler options</h2>
56                 <table border="0">
57                     <tr>
58                         <td>Options</td>
59                         <td>What it does</td>
60                     </tr>
61                     <tr>
62                         <td>-l&lt;path&gt;</td>
63                         <td>Adds &lt;path&gt; to the directories searched by the preprocessor for include file resolution.</td>
64                     </tr>
65                     <tr>
66                         <td>-o &lt;file&gt;</td>
67                         <td>Generates the named executable (progs.src) file (when not specified default is progs.src).</td>
68                     </tr>
69                     
70                     <tr>
71                         <td>-O&lt;level&gt;</td>
72                         <td>Specfies the optimization level: highest being 3, lowest being 0 (no optimization).</td>
73                     </tr>
74                     <tr>
75                         <td>-E</td>
76                         <td>Instructs the compiler to only preprocess the input, writing the preprocessed output to stdout</td>
77                     </tr>
78                     <tr>
79                         <td>-Wall</td>
80                         <td>Enables all compiled warnings for the selcted standard</td>
81                     </tr>
82                     <tr>
83                         <td>-Werror</td>
84                         <td>Instruct the compiler to treat all warnings as errors</td>
85                     </tr>
86                     <tr>
87                         <td>-std=&lt;standard&gt;</td>
88                         <td>Selects the standard dialect</td>
89                     </tr>
90                 </table>
91                 <h2>Predefined Macros</h2>
92                 <table border="0">
93                     <tr>
94                         <td>Macro</td>
95                         <td>What it represents</td>
96                     </tr>
97                     <tr>
98                         <td>GMQCC</td>
99                         <td>Specifies the current selected standard is gmqcc.</td>
100                     </tr>
101                     <tr>
102                         <td>FTEQCC</td>
103                         <td>Specifies the current selected standard is fteqcc.</td>
104                     </tr>
105                     <tr>
106                         <td>QCC</td>
107                         <td>Specifies the current selected standard is qcc.</td>
108                     </tr>
109                     
110                     <tr>
111                         <td>__STD_VERSION_MINOR__</td>
112                         <td>Specifies the current selected stanadards minor version number.</td>
113                     </tr>
114                     <tr>
115                         <td>__STD_VERSION_MAJOR__</td>
116                         <td>Specifies the current selected stanadards major version number.</td>
117                     </tr>
118                 </table>
119                 <h2>Unsupported compatability options</h2>
120                 <p>
121                     GMQCC strives hard for compatability with standard dialects, but not all
122                     features of those standards might be implemented. The unsupported features
123                     are presented below:
124                     <table border="0">
125                         <tr>
126                             <td>Feature</td>
127                             <td>Standard</td>
128                         </tr>
129                         <tr>
130                             <td>Inline Assembly</td>
131                             <td>FTEQCC</td>
132                         </tr>
133                         <tr>
134                             <td>Macro expansion in strings</td>
135                             <td>FTEQCC</td>
136                         </tr>
137                     </table>
138                 </p>
139                 <h1>Less common compiler options</h1>
140                 <h2>Code generation options</h2>
141                 <table border="0">
142                     <tr>
143                         <td>Option</td>
144                         <td>What it does</td>
145                     </tr>
146                     <tr>
147                         <td>-foverlap-locals</td>
148                         <td>Reduces codesize by overlapping locals where possible</td>
149                     </tr>
150                     <tr>
151                         <td>-fdarkplaces-string-table-bug</td>
152                         <td>Works around a bug in older Darkplaces engine builds where the stringtable size is computed wrong</td>
153                     </tr>
154                     <tr>
155                         <td>-fadjust-vector-fields</td>
156                         <td>corrects assignment of vector field pointers (STORE_V instead of STORE_FLD)</td>
157                     </tr>
158                     <tr>
159                         <td>-fftepp</td>
160                         <td>Enables FTEQ preprocessor</td>
161                     </tr>
162                     <tr>
163                         <td>-frelaxted-switch</td>
164                         <td>Relaxes switch statement semantics</td>
165                     </tr>
166                     <tr>
167                         <td>-fshort-logic</td>
168                         <td>Enables short circut evaluation/logic</td>
169                     </tr>
170                     <tr>
171                         <td>-fperl-logic</td>
172                         <td>Enables perl evalutaion/logic</td>
173                     </tr>
174                 </table>
175                 <h2>Warning options</h2>
176                 <table border="0">
177                     <tr>
178                         <td>Option</td>
179                         <td>What it does</td>
180                     </tr>
181                     <tr>
182                         <td>-Wunused-uninitialized</td>
183                         <td>Enables warnings about unused or uninitialized variables</td>
184                     </tr>
185                     <tr>
186                         <td>-Wunknwon-control-sequence</td>
187                         <td>Enables warnings about unknown control sequences</td>
188                     </tr>
189                     <tr>
190                         <td>-Wextension</td>
191                         <td>Enables warnings about the use of (an) extension(s)</td>
192                     </tr>
193                     <tr>
194                         <td>-Wfield-redeclared</td>
195                         <td>Enables warnings about redeclared fields</td>
196                     </tr>
197                     <tr>
198                         <td>-Wmissing-return-values</td>
199                         <td>Enables warnings about missing return values</td>
200                     </tr>
201                     <tr>
202                         <td>-Wtoo-few-paramaters</td>
203                         <td>Enables warnings about missing paramaters for function calls</td>
204                     </tr>
205                     <tr>
206                         <td>-Wlocal-shadows</td>
207                         <td>Enables warnings about locals shadowing paramaters or other locals</td>
208                     </tr>
209                     <tr>
210                         <td>-Wlocal-constants</td>
211                         <td>Enables warnings about constants specified as locals</td>
212                     </tr>
213                     <tr>
214                         <td>-Wvoid-variables</td>
215                         <td>Enables warnings about variables declared as type void</td>
216                     </tr>
217                     <tr>
218                         <td>-Wimplicit-function-pointer</td>
219                         <td>Enables warnings about implicitly declared function pointers</td>
220                     </tr>
221                     <tr>
222                         <td>-Wvariadic-function</td>
223                         <td>Enables warnings for use of varadics for non-builtin functions</td>
224                     </tr>
225                     <tr>
226                         <td>-Wframe-macros</td>
227                         <td>Enables warnings about duplicated frame macros</td>
228                     </tr>
229                     <tr>
230                         <td>-Weffectless-statement</td>
231                         <td>Enables warnings about effectiveless statements</td>
232                     </tr>
233                     <tr>
234                         <td>-Wend-sys-field</td>
235                         <td>Enables warnings of end_sys_fields being declared a field</td>
236                     </tr>
237                     <tr>
238                         <td>-Wassign-function-types</td>
239                         <td>Enables warnings for incompatible function pointer signatures used in assignment</td>
240                     </tr>
241                     <tr>
242                         <td>-Wpreprocessor</td>
243                         <td>Enables warnings about redefined macros</td>
244                     </tr>
245                     <tr>
246                         <td>-Wmultifile-if</td>
247                         <td>Enables warnings about multifile if statements</td>
248                     </tr>
249                 </table>
250                 <p>
251                     Individual warnings may be disabled with &nbsp;-Wno&lt;warning&gt;
252                     <pre>$ gmqcc -Wno-frame-macros # disables frame duplication warning</pre>
253                 </p>
254                 <h2>Miscellaneous options</h2>
255                 <table border="0">
256                     <tr>
257                         <td>Option</td>
258                         <td>What it does</td>
259                     </tr>
260                     <tr>
261                         <td>-force-crc=&lt;num&gt;</td>
262                         <td>Forces a specific checsum into the header</td>
263                     </tr>
264                     <tr>
265                         <td>-debug</td>
266                         <td>Turns on compiler debug messages</td>
267                     </tr>
268                     <tr>
269                         <td>-memchk</td>
270                         <td>Turns on compiler memory leak checker</td>
271                     </tr>
272                     
273                     <tr>
274                         <td>-Whelp or -W?</td>
275                         <td>Lists all warning options</td>
276                     </tr>
277                     
278                     <tr>
279                         <td>-fhelp or -f?</td>
280                         <td>Lists all code generation options</td>
281                     </tr>
282                 </table>
283                 <h3>Support or Contact</h3>
284                 <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> 
285             </section>
286             <footer>
287                 <script type="text/javascript" src="http://www.ohloh.net/p/602517/widgets/project_partner_badge.js"></script>
288             </footer>
289         </div>
290         <!--[if !IE]><script>fixScale(document);</script><![endif]-->
291     </body>
292 </html>