]> de.git.xonotic.org Git - xonotic/gmqcc.git/blob - gmqcc.ini.example
gmqcc.ini.example: -Wparenthesis
[xonotic/gmqcc.git] / gmqcc.ini.example
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.
9
10
11 # These are common compiler flags usually represented via the -f prefix
12 # from the command line.
13 [flags]
14     # Enabling this can potentially reduces code size by overlapping
15     # locals where possible.
16     OVERLAP_LOCALS               = false
17
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
23
24     # Enabling this corrects the assignment of vector field pointers via
25     # subsituting STORE_FLD with STORE_V.
26     ADJUST_VECTOR_FIELDS         = true
27
28     # Enabling this allows the use of the FTEQ preprocessor, as well as
29     # additional preprocessing directives such as #error and #warning.
30     FTEPP                        = true
31
32     # Enabling this relaxes switch statement semantics
33     RELAXED_SWITCH               = false
34
35     # Enabling this allows short-circut evaluation and logic, opposed
36     # to full evaluation.
37     SHORT_LOGIC                  = false
38
39     # Enabling this allows perl-like evaluation/logic.
40     PERL_LOGIC                   = true
41
42     # Enabling this allows the use of the "translatable strings" extension
43     # assisted by .po files.
44     TRANSLATABLE_STRINGS         = false
45
46     # Enabling this prevents initializations from becoming constant unless
47     # 'const' is specified as a type qualifier.
48     INITIALIZED_NONCONSTANTS     = false
49
50     # Enabling this allows function types to be assignable even if their
51     # signatures are invariant of each other.
52     ASSIGN_FUNCTION_TYPES        = false
53
54     # Enabling this will allow the generation of .lno files for engine
55     # virtual machine backtraces (this is enabled with -g as well).
56     LNO                          = false
57
58     # Enabling this corrects ternary percedence bugs present in fteqcc.
59     CORRECT_TERNARY              = true
60
61     # Prevent the creation of _x, _y and _z progdefs for vectors
62     SINGLE_VECTOR_DEFS           = false
63
64     # Cast vectors to real booleans when used in logic expressions.
65     # This is achieved by using NOT_V.
66     CORRECT_LOGIC                = false
67
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
73
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
76     # boolean value.
77     FALSE_EMPTY_STRINGS          = false
78
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.
82     UTF8
83
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.
88     BAIL_ON_WERROR               = true
89
90     # Allow loops and switches to be labeled and break and continue to take an
91     # optional label to target a specific loop/switch.
92     LOOP_LABELS                  = false
93
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.
96     UNTYPED_NIL                  = false
97
98     # Be "permissive". For instance, when -funtyped-nil is used, this allows local
99     # variables with the name 'nil' to be declared.
100     PREMISSIVE                   = false
101
102 # These are all the warnings, usually present via the -W prefix from
103 # the command line.
104 [warnings]
105     # ?? Used for debugging ??
106     DEBUG                        = false
107
108     # Enables warnings about unused variables.
109     UNUSED_VARIABLE              = true
110
111     # Enables warnings about uninitialized variables.
112     USED_UNINITIALIZED           = true
113
114     # Enables warnings about the unknown control sequences in the source
115     # stream.
116     UNKNOWN_CONTROL_SEQUENCE     = true
117
118     # Enables warnings about the use of (an) extension(s).
119     EXTENSIONS                   = true
120
121     # Enables warnings about redeclared fields.
122     FIELD_REDECLARED             = true
123
124     # Enables warnings about missing return values.
125     MISSING_RETURN_VALUES        = true
126
127     # Enables warnings about missing parameters for function calls.
128     TOO_FEW_PARAMETERS           = true
129
130     # Enables warnings about locals shadowing parameters or other locals.
131     LOCAL_SHADOWS                = true
132
133     # Enables warnings about constants specified as locals.
134     LOCAL_CONSTANTS              = true
135
136     # Enables warnings about variables declared as type void.
137     VOID_VARIABLES               = true
138
139     # Enables warnings about implicitally declared function pointers.
140     IMPLICIT_FUNCTION_POINTER    = true
141
142     # Enables warnings for use of varadics for non-builtin functions.
143     VARIADIC_FUNCTION            = true
144
145     # Enables warnings about duplicated frame macros.
146     FRAME_MACROS                 = true
147
148     # Enables warnings about effectivless statements.
149     EFFECTLESS_STATEMENT         = true
150
151     # Enables warnings of "end_sys_fields" beiing declared a field.
152     END_SYS_FIELDS               = true
153
154     # Enables warnings for infompatible function pointer signatures used
155     # in assignment.
156     ASSIGN_FUNCTION_TYPES        = true
157
158     # Enables warnings about redefined macros in the preprocessor
159     PREPROCESSOR                 = true
160
161     # Enables warnings about multi-file if statements
162     MULTIFILE_IF                 = true
163
164     # Enables warnings about double declarations
165     DOUBLE_DECLARATION           = true
166
167     # Enables warnings about type qualifiers containing both 'var' and
168     # 'const'
169     CONST_VAR                    = true
170
171     # Enables warnings about the use of multibytes characters / constants
172     MULTIBYTE_CHARACTER          = true
173
174     # Enables warnings about ternary expressions whos precedence may be
175     # not what was initially expected.
176     TERNARY_PRECEDENCE           = true
177
178     # Enables warnings about unknown pragmas.
179     UNKNOWN_PRAGMAS              = true
180
181     # Enables warnings about unreachable code.
182     UNREACHABLE_CODE             = true
183
184     # Enables preprocessor "#warnings"
185     CPP                          = true
186
187     # With the [[attribute]] syntax enabled, warn when an unknown
188     # attribute is encountered. Its first token will be included in the
189     # message.
190     UNKNOWN_ATTRIBUTE            = true
191
192     # Warn when declaring variables or fields with a reserved name like 'nil'
193     RESERVED_NAMES               = true
194
195     # Warn about 'const'-qualified global variables with no initializing value.
196     UNINITIALIZED_CONSTANT       = true
197
198     # Warn about non-constant global variables with no initializing value.
199     UNINITIALIZED_GLOBAL         = true
200
201     # Redeclaring a 'const' as 'var' or the other way round.
202     DIFFERENT_QUALIFIERS         = true
203
204     # Redeclaring a function with different attributes such as
205     # [[noreturn]]
206     DIFFERENT_ATTRIBUTES         = true
207
208     # Warn when a function is marked with the attribute
209     # "[[deprecated]]". This flag enables a warning on calls to functions
210     # marked as such.
211     DEPRECATED                   = true
212
213     # Warn about possible problems from missing parenthesis, like an
214     # assignment used as truth value without additional parens around.
215     PARENTHESIS                  = true
216
217 # Finally these are all the optimizations, usually present via the -O
218 # prefix from the command line.
219 [optimizations]
220     # Enables peephole optimizations.
221     PEEPHOLE                     = true
222
223     # Enables localtemp omission optimizations.
224     LOCALTEMPS                   = true
225
226     # Enables tail recrusion optimizationd.
227     TAIL_RECURSION               = true
228
229     # Enables tail-call optimizations. (Not implemented)
230     TAIL_CALLS                   = true
231
232     # Every function where it is safe to do so will share its local data section
233     # with the others. The criteria are currently that the function must not have
234     # any possibly uninitialized locals, or local arrays regardless of how they
235     # are initialized.
236     OVERLAP_LOCALS               = false
237
238     # Strip out the names of constants to save some space in the progs.dat
239     STRIP_CONSTANT_NAMES         = true
240
241     # Aggressivly reuse strings in the string-section
242     OVERLAP_STRINGS              = true
243
244     # Have expressions which are used as function parameters evaluate directly
245     # into the parameter-globals if possible.
246     # This avoids a whole lot of copying.
247     CALL_STORES                  = true
248
249     # Do not create a RETURN instruction at the end functions of return-type void.
250     VOID_RETURN                  = true
251
252     # Turn extraction-multiplications such as (a_vector * '0 1 0')
253     # into direct component accesses
254     VECTOR_COMPONENTS            = true