1 # This is an example INI file that can be used to set compiler options
2 # without the rquirement for supplying them as arguments on the command
3 # line, this can be coupled with progs.src. To utilize this file there
4 # are two options availble, if it's named "gmqcc.ini" or "gmqcc.cfg" and
5 # the file exists in the directory that GMQCC is invoked from, the compiler
6 # will implicitally find and execute regardless. For more freedom you may
7 # use -config=<file> from the command line to specify a more explicit
8 # directory/name.ext for the configuration file.
11 # These are common compiler flags usually represented via the -f prefix
12 # from the command line.
14 # Enabling this can potentially reduces code size by overlapping
15 # locals where possible.
16 OVERLAP_LOCALS = false
18 # in some older versions of the Darkplaces engine the string table
19 # size is computed wrong causing compiled progs.dat to fail to load
20 # Enabling this works around the bug by writing a few additional
21 # null bytes to the end of the string table to compensate.
22 DARKPLACES_STRING_TABLE_BUG = false
24 # Enabling this corrects the assignment of vector field pointers via
25 # subsituting STORE_FLD with STORE_V.
26 ADJUST_VECTOR_FIELDS = true
28 # Enabling this allows the use of the FTEQ preprocessor, as well as
29 # additional preprocessing directives such as #error and #warning.
32 # Enabling this relaxes switch statement semantics
33 RELAXED_SWITCH = false
35 # Enabling this allows short-circut evaluation and logic, opposed
39 # Enabling this allows perl-like evaluation/logic.
42 # Enabling this allows the use of the "translatable strings" extension
43 # assisted by .po files.
44 TRANSLATABLE_STRINGS = false
46 # Enabling this prevents initializations from becoming constant unless
47 # 'const' is specified as a type qualifier.
48 INITIALIZED_NONCONSTANTS = false
50 # Enabling this allows function types to be assignable even if their
51 # signatures are invariant of each other.
52 ASSIGN_FUNCTION_TYPES = false
54 # Enabling this will allow the generation of .lno files for engine
55 # virtual machine backtraces (this is enabled with -g as well).
58 # Enabling this corrects ternary percedence bugs present in fteqcc.
59 CORRECT_TERNARY = true
61 # Prevent the creation of _x, _y and _z progdefs for vectors
62 SINGLE_VECTOR_DEFS = false
64 # Cast vectors to real booleans when used in logic expressions.
65 # This is achieved by using NOT_V.
68 # Always treat empty strings as true. Usuall !"" yields true, because
69 # the string-NOT instruction considers empty strings to be false, while
70 # an empty string as condition for 'if' will be considered true, since
71 # only the numerical value of the global is looked at.
72 TRUE_EMPTY_STRINGS = false
74 # Opposite of the above, empty strings are always false. Similar to
75 # CORRECT_LOGIC this will always use NOT_S to cast a string to a real
77 FALSE_EMPTY_STRINGS = false
79 # Recognize utf-8 characters in character constants, and encode
80 # codepoint escape sequences in strings as utf-8. This essentially allows
81 # \{1234} escape sequences to be higher than 255.
84 # When a warning is printed and it is set to be treated as error via
85 # a -Werror switch, compilation will be stopped, unless this is false.
86 # When this is false, the rest of the code will be compiled, and at the end
87 # the file and line of the first warning will be shown.
90 # Allow loops and switches to be labeled and break and continue to take an
91 # optional label to target a specific loop/switch.
94 # Enable the 'nil' null constant, which has no type. It can be used as the
95 # right hand of any assignment regardless of the required type.
98 # Be "permissive". For instance, when -funtyped-nil is used, this allows local
99 # variables with the name 'nil' to be declared.
102 # Allow vararg access from within QC of the form: ...(argnumber, type)
105 # Most Quake VMs, including the one from FTEQW or up till recently
106 # Darkplaces, do not cope well with vector instructions with overlapping
107 # input and output. This option will avoid producing such code.
108 LEGACY_VECTOR_MATHS = true
110 # These are all the warnings, usually present via the -W prefix from
113 # ?? Used for debugging ??
116 # Enables warnings about unused variables.
117 UNUSED_VARIABLE = true
119 # Enables warnings about uninitialized variables.
120 USED_UNINITIALIZED = true
122 # Enables warnings about the unknown control sequences in the source
124 UNKNOWN_CONTROL_SEQUENCE = true
126 # Enables warnings about the use of (an) extension(s).
129 # Enables warnings about redeclared fields.
130 FIELD_REDECLARED = true
132 # Enables warnings about missing return values.
133 MISSING_RETURN_VALUES = true
135 # Enables warnings about missing parameters for function calls.
136 INVALID_PARAMETER_COUNT = true
138 # Enables warnings about locals shadowing parameters or other locals.
141 # Enables warnings about constants specified as locals.
142 LOCAL_CONSTANTS = true
144 # Enables warnings about variables declared as type void.
145 VOID_VARIABLES = true
147 # Enables warnings about implicitally declared function pointers.
148 IMPLICIT_FUNCTION_POINTER = true
150 # Enables warnings for use of varadics for non-builtin functions.
151 VARIADIC_FUNCTION = true
153 # Enables warnings about duplicated frame macros.
156 # Enables warnings about effectivless statements.
157 EFFECTLESS_STATEMENT = true
159 # Enables warnings of "end_sys_fields" beiing declared a field.
160 END_SYS_FIELDS = true
162 # Enables warnings for infompatible function pointer signatures used
164 ASSIGN_FUNCTION_TYPES = true
166 # Enables warnings about redefined macros in the preprocessor
169 # Enables warnings about multi-file if statements
172 # Enables warnings about double declarations
173 DOUBLE_DECLARATION = true
175 # Enables warnings about type qualifiers containing both 'var' and
179 # Enables warnings about the use of multibytes characters / constants
180 MULTIBYTE_CHARACTER = true
182 # Enables warnings about ternary expressions whos precedence may be
183 # not what was initially expected.
184 TERNARY_PRECEDENCE = true
186 # Enables warnings about unknown pragmas.
187 UNKNOWN_PRAGMAS = true
189 # Enables warnings about unreachable code.
190 UNREACHABLE_CODE = true
192 # Enables preprocessor "#warnings"
195 # With the [[attribute]] syntax enabled, warn when an unknown
196 # attribute is encountered. Its first token will be included in the
198 UNKNOWN_ATTRIBUTE = true
200 # Warn when declaring variables or fields with a reserved name like 'nil'
201 RESERVED_NAMES = true
203 # Warn about 'const'-qualified global variables with no initializing value.
204 UNINITIALIZED_CONSTANT = true
206 # Warn about non-constant global variables with no initializing value.
207 UNINITIALIZED_GLOBAL = true
209 # Redeclaring a 'const' as 'var' or the other way round.
210 DIFFERENT_QUALIFIERS = true
212 # Redeclaring a function with different attributes such as
214 DIFFERENT_ATTRIBUTES = true
216 # Warn when a function is marked with the attribute
217 # "[[deprecated]]". This flag enables a warning on calls to functions
221 # Warn about possible problems from missing parenthesis, like an
222 # assignment used as truth value without additional parens around.
225 # Finally these are all the optimizations, usually present via the -O
226 # prefix from the command line.
228 # Enables peephole optimizations.
231 # Enables localtemp omission optimizations.
234 # Enables tail recrusion optimizationd.
235 TAIL_RECURSION = true
237 # Enables tail-call optimizations. (Not implemented)
240 # Every function where it is safe to do so will share its local data section
241 # with the others. The criteria are currently that the function must not have
242 # any possibly uninitialized locals, or local arrays regardless of how they
244 OVERLAP_LOCALS = false
246 # Strip out the names of constants to save some space in the progs.dat
247 STRIP_CONSTANT_NAMES = true
249 # Aggressivly reuse strings in the string-section
250 OVERLAP_STRINGS = true
252 # Have expressions which are used as function parameters evaluate directly
253 # into the parameter-globals if possible.
254 # This avoids a whole lot of copying.
257 # Do not create a RETURN instruction at the end functions of return-type void.
260 # Turn extraction-multiplications such as (a_vector * '0 1 0')
261 # into direct component accesses
262 VECTOR_COMPONENTS = true