]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - doc/gmqcc.1
manpage: -flegacy-vector-maths
[xonotic/gmqcc.git] / doc / gmqcc.1
index 940afd0fa04919ccd81054ec782ee0d7ae66d5c1..5240c4ea516026307d08ff85fda4a66016ee0443 100644 (file)
@@ -142,6 +142,19 @@ them.
 .fi
 .in
 .TP
+.B "--add-info"
+Adds compiler information to the generated binary file. Currently
+this includes the following globals:
+.RS
+.IP "reserved:version"
+String containing the compiler version as printed by the --version
+parameter.
+.RE
+.TP
+.BR "--correct" ", " "--no-correct"
+When enabled, errors about undefined values try to suggest an existing
+value via spell checking.
+.TP
 .B "-dump"
 DEBUG OPTION. Print the code's intermediate representation before the
 optimization and finalization passes to stdout before generating the
@@ -448,13 +461,18 @@ 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.
 .sp
-Note that this is different from fteqcc's __NULL__ in that gmqcc
-generates an actual empty global, rather than using the global at
-offset 0 because it would overlap with the global RETURN variable when
-dealing with vectors, which starts at offset 1. Setting a vector to
-__NULL__ in fteqcc causes only the vector's x component to be 0.
-However, its y and z components will contain the previous x and y
-components of the global OFS_RETURN.
+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.
+.sp
+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.
 .TP
 .B -fpermissive
 Various effects, usually to weaken some conditions.
@@ -462,6 +480,28 @@ Various effects, usually to weaken some conditions.
 .IP "with -funtyped-nil"
 Allow local variables named 'nil'. (This will not allow declaring a
 global of that name.)
+.RE
+.TP
+.B -fvariadic-args
+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:
+.sp
+.in +4
+.nf
+void vafunc(string...count) {
+    float i;
+    for (i = 0; i < count; ++i)
+        print(...(i, string), "\\n");
+}
+.fi
+.in
+.TP -flegacy-vector-maths
+Most Quake VMs, including the one from FTEQW or up till recently
+Darkplaces, do not cope well with vector instructions with overlapping
+input and output. This option will avoid producing such code.
 .SH OPTIMIZATIONS
 .TP
 .B -Opeephole