- # Enabling this can potentially reduces code size by overlapping
- # locals where possible.
- OVERLAP_LOCALS = false
-
- # in some older versions of the Darkplaces engine the string table
- # size is computed wrong causing compiled progs.dat to fail to load
- # Enabling this works around the bug by writing a few additional
- # null bytes to the end of the string table to compensate.
- DARKPLACES_STRING_TABLE_BUG = false
-
- # Enabling this corrects the assignment of vector field pointers via
- # subsituting STORE_FLD with STORE_V.
- ADJUST_VECTOR_FIELDS = true
-
- # Enabling this allows the use of the FTEQ preprocessor, as well as
- # additional preprocessing directives such as #error and #warning.
- FTEPP = true
-
- # Enabling this relaxes switch statement semantics
- RELAXED_SWITCH = false
-
- # Enabling this allows short-circut evaluation and logic, opposed
- # to full evaluation.
- SHORT_LOGIC = false
-
- # Enabling this allows perl-like evaluation/logic.
- PERL_LOGIC = true
-
- # Enabling this allows the use of the "translatable strings" extension
- # assisted by .po files.
- TRANSLATABLE_STRINGS = false
-
- # Enabling this prevents initializations from becoming constant unless
- # 'const' is specified as a type qualifier.
- INITIALIZED_NONCONSTANTS = false
-
- # Enabling this allows function types to be assignable even if their
- # signatures are invariant of each other.
- ASSIGN_FUNCTION_TYPES = false
-
- # Enabling this will allow the generation of .lno files for engine
- # virtual machine backtraces (this is enabled with -g as well).
- LNO = false
-
- # Enabling this corrects ternary percedence bugs present in fteqcc.
- CORRECT_TERNARY = true
-
- # Prevent the creation of _x, _y and _z progdefs for vectors
- SINGLE_VECTOR_DEFS = false
-
- # Cast vectors to real booleans when used in logic expressions.
- # This is achieved by using NOT_V.
- CORRECT_LOGIC = false
-
- # Always treat empty strings as true. Usuall !"" yields true, because
- # the string-NOT instruction considers empty strings to be false, while
- # an empty string as condition for 'if' will be considered true, since
- # only the numerical value of the global is looked at.
- TRUE_EMPTY_STRINGS = false
-
- # Opposite of the above, empty strings are always false. Similar to
- # CORRECT_LOGIC this will always use NOT_S to cast a string to a real
- # boolean value.
- FALSE_EMPTY_STRINGS = false
-
- # Recognize utf-8 characters in character constants, and encode
- # codepoint escape sequences in strings as utf-8. This essentially allows
- # \{1234} escape sequences to be higher than 255.
- UTF8
-
- # When a warning is printed and it is set to be treated as error via
- # a -Werror switch, compilation will be stopped, unless this is false.
- # When this is false, the rest of the code will be compiled, and at the end
- # the file and line of the first warning will be shown.
- BAIL_ON_WERROR = true
-
- # Allow loops and switches to be labeled and break and continue to take an
- # optional label to target a specific loop/switch.
- LOOP_LABELS = false
-
- # Enable the 'nil' null constant, which has no type. It can be used as the
- # right hand of any assignment regardless of the required type.
- UNTYPED_NIL = false
-
- # Be "permissive". For instance, when -funtyped-nil is used, this allows local
- # variables with the name 'nil' to be declared.
- PREMISSIVE = false
-
-# These are all the warnings, usually present via the -W prefix from
-# the command line.
+ #Add some additional characters to the string table in order to
+ #compensate for a wrong boundcheck in some specific version of the
+ #darkplaces engine.
+
+ DARKPLACES_STRING_TABLE_BUG = true
+
+
+ #When assigning to field pointers of type .vector the common be‐
+ #haviour in compilers like fteqcc is to only assign the x-compo‐
+ #nent of the pointer. This means that you can use the vector as
+ #such, but you cannot use its y and z components directly. This
+ #flag fixes this behaviour. Before using it make sure your code
+ #does not depend on the buggy behaviour.
+
+ ADJUST_VECTOR_FIELDS = true
+
+
+ #Enable a partially fteqcc-compatible preprocessor. It supports
+ #all the features used in the Xonotic codebase. If you need more,
+ #write a ticket.
+
+ FTEPP = true
+
+
+ #Enable some predefined macros. This only works in combination
+ #with '-fftepp' and is currently not included by '-std=fteqcc'.
+ #The following macros will be added:
+ #
+ # __LINE__
+ # __FILE__
+ # __COUNTER__
+ # __COUNTER_LAST__
+ # __RANDOM__
+ # __RANDOM_LAST__
+ # __DATE__
+ # __TIME__
+ # __FUNC__
+ #
+ #Note that __FUNC__ is not actually a preprocessor macro, but is
+ #recognized by the parser even with the preprocessor disabled.
+ #
+ #Note that fteqcc also defines __NULL__ which becomes the first
+ #global. Assigning it to a vector does not yield the same result
+ #as in gmqcc where __NULL__ is defined to nil (See -funtyped-nil
+ #), which will cause the vector to be zero in all components. With
+ #fteqcc only the first component will be 0, while the other two
+ #will become the first to of the global return value. This behav‐
+ #ior is odd and relying on it should be discouraged, and thus is
+ #not supported by gmqcc.
+
+ FTEPP_PREDEFS = false
+
+
+ #Allow switch cases to use non constant variables.
+
+ RELAXED_SWITCH = true
+
+
+ #Perform early out in logical AND and OR expressions. The final
+ #result will be either a 0 or a 1, see the next flag for more pos‐
+ #sibilities.
+
+ SHORT_LOGIC = true
+
+
+ #In many languages, logical expressions perform early out in a
+ #special way: If the left operand of an AND yeilds true, or the
+ #one of an OR yields false, the complete expression evaluates to
+ #the right side. Thus ‘true && 5’ evaluates to 5 rather than 1.
+
+ PERL_LOGIC = false
+
+
+ #Enable the underscore intrinsic: Using ‘_("A string constant")’
+ #will cause the string immediate to get a name with a "dotrans‐
+ #late_" prefix. The darkplaces engine recognizes these and trans‐
+ #lates them in a way similar to how gettext works.
+
+ TRANSLATABLE_STRINGS = true
+
+
+ #Don't implicitly convert initialized variables to constants. With
+ #this flag, the const keyword is required to make a constant.
+
+ INITIALIZED_NONCONSTANTS = false
+
+
+ #If this flag is not set, (and it is set by default in the qcc and
+ #fteqcc standards), assigning function pointers of mismatching
+ #signatures will result in an error rather than a warning.
+
+ ASSIGN_FUNCTION_TYPES = true
+
+
+ #Produce a linenumber file along with the output .dat file.
+
+ LNO = false
+
+
+ #Use C's operator precedence for ternary expressions. Unless your
+ #code depends on fteqcc-compatible behaviour, you'll want to use
+ #this option.
+
+ CORRECT_TERNARY = true
+
+
+ #Normally vectors generate 4 defs, once for the vector, and once
+ #for its components with _x, _y, _z suffixes. This option prevents
+ #components from being listed.
+
+
+ SINGLE_VECTOR_DEFS = true
+
+
+ #Most QC compilers translate ‘if(a_vector)’ directly as an IF on
+ #the vector, which means only the x-component is checked. This
+ #option causes vectors to be cast to actual booleans via a NOT_V
+ #and, if necessary, a NOT_F chained to it.
+ #
+ # if (a_vector) // becomes
+ # if not(!a_vector)
+ # // likewise
+ # a = a_vector && a_float // becomes
+ # a = !!a_vector && a_float
+
+ CORRECT_LOGIC = true
+
+
+ #An empty string is considered to be true everywhere. The NOT_S
+ #instruction usually considers an empty string to be false, this
+ #option effectively causes the unary not in strings to use NOT_F
+ #instead.
+
+ TRUE_EMPTY_STRINGS = false
+
+
+ #An empty string is considered to be false everywhere. This means
+ #loops and if statements which depend on a string will perform a
+ #NOT_S instruction on the string before using it.
+
+ FALSE_EMPTY_STRINGS = true
+
+
+ #Enable utf8 characters. This allows utf-8 encoded character con‐
+ #stants, and escape sequence codepoints in the valid utf-8 range.
+ #Effectively enabling escape sequences like '\{x2211}'.
+
+ UTF8 = true
+
+
+ #When a warning is treated as an error, and this option is set
+ #(which it is by default), it is like any other error and will
+ #cause compilation to stop. When disabling this flag by using
+ #-fno-bail-on-werror, compilation will continue until the end, but
+ #no output is generated. Instead the first such error message's
+ #context is shown.
+
+ BAIL_ON_WERROR = false
+
+
+ #Allow loops to be labeled, and allow 'break' and 'continue' to
+ #take an optional label to decide which loop to actually jump out
+ #of or continue.
+ #
+ # for :outer (i = 0; i < n; ++i) {
+ # while (inner) {
+ # ...;
+ # if (something)
+ # continue outer;
+ # }
+ # }
+
+ LOOP_LABELS = true
+
+
+ #Adds a global named 'nil' which is of no type and can be assigned
+ #to anything. No typechecking will be performed on assignments.
+ #Assigning to it is forbidden, using it in any other kind of
+ #expression is also not allowed.
+ #
+ #Note that this is different from fteqcc's __NULL__: In fteqcc,
+ #__NULL__ maps to the integer written as '0i'. It's can be
+ #assigned to function pointers and integers, but it'll error about
+ #invalid instructions when assigning it to floats without enabling
+ #the FTE instruction set. There's also a bug which allows it to be
+ #assigned to vectors, for which the source will be the global at
+ #offset 0, meaning the vector's y and z components will contain
+ #the OFS_RETURN x and y components.#
+ #
+ #In that gmqcc the nil global is an actual global filled with
+ #zeroes, and can be assigned to anything including fields, vectors
+ #or function pointers, and they end up becoming zeroed.
+
+
+ UNTYPED_NIL = true
+
+
+ #Various effects, usually to weaken some conditions.
+ # with -funtyped-nil
+ # Allow local variables named ‘nil’. (This will not
+ # allow declaring a global of that name.)
+
+ PERMISSIVE = false
+
+
+ #Allow variadic parameters to be accessed by QC code. This can be
+ #achieved via the '...' function, which takes a parameter index
+ #and a typename.
+ #
+ #Example:
+ #
+ # void vafunc(string...count) {
+ # float i;
+ # for (i = 0; i < count; ++i)
+ # print(...(i, string), "\n");
+ # }
+
+ VARIADIC_ARGS = true
+
+
+ #Most Quake VMs, including the one from FTEQW or up till recently
+ #Darkplaces, do not cope well with vector instructions with over‐
+ #lapping input and output. This option will avoid producing such
+ #code.
+
+ LEGACY_VECTOR_MATHS = false
+
+
+ #Usually builtin-numbers are just immediate constants. With this
+ #flag expressions can be used, as long as they are compile-time
+ #constant.
+ #
+ #Example:
+ #
+ # void printA() = #1; // the usual way
+ # void printB() = #2-1; // with a constant expression
+
+ EXPRESSIONS_FOR_BUILTINS = true
+
+
+ #Enabiling this option will allow assigning values or expressions
+ #to the return keyword as if it were a local variable of the same
+ #type as the function's signature's return type.
+ #
+ #Example:
+ #
+ # float bar() { return 1024; }
+ # float fun() {
+ # return = bar();
+ # return; // returns value of bar (this can be omitted)
+ # }
+
+ RETURN_ASSIGNMENTS = true
+
+
+ #When passing on varargs to a different functions, this turns some
+ #static error cases into warnings. Like when the caller's varargs
+ #are restricted to a different type than the callee's parameter.
+ #Or a list of unrestricted varargs is passed into restricted
+ #varargs.
+
+ UNSAFE_VARARGS = false
+
+
+ #Always use STORE_F, LOAD_F, STOREP_F when accessing scalar variables.
+ #This is somewhat incorrect assembly instruction use, but in all engines
+ #they do exactly the same. This makes disassembly output harder to read,
+ #breaks decompilers, but causes the output file to be better compressible.
+
+ TYPELESS_STORES = false
+
+
+ #In commutative instructions, always put the lower-numbered operand first.
+ #This shaves off 1 byte of entropy from all these instructions, reducing
+ #compressed size of the output file.
+
+ SORT_OPERANDS = false
+
+
+