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