]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - doc/gmqcc.1
Arithmetic exception flag and a plethora of tests.
[xonotic/gmqcc.git] / doc / gmqcc.1
index f3f6517550a043a1a77164b9153fd49dbf692b26..33a0eff3fbedef27673b700dc9511176e3be2029 100644 (file)
@@ -153,7 +153,7 @@ Adds compiler information to the generated binary file. Currently
 this includes the following globals:
 .Bl -tag -width indent -compact
 .It Li reserved:version
-String containing the compiler version as printed by the --version
+String containing the compiler version as printed by the \-\-version
 parameter.
 .El
 .It Fl -correct , Fl -no-correct
@@ -327,10 +327,27 @@ it can happen that incompatible types are passed to functions. This
 enables several warnings when static typechecking cannot guarantee
 consistent behavior.
 .It Fl W Ns Cm breakdef
-When compiling original id1 QC, there is a definition for `break`
+When compiling original id1 QC there is a definition for `break`
 which conflicts with the 'break' keyword in GMQCC. Enabling this
-warning will print a warning when the definition occurs. The
-definition is ignored for both cases.
+will print a warning when the definition occurs. The definition is
+ignored for both cases.
+.It Fl W Ns Cm const-overwrite
+When compiling original QuakeWorld QC there are instances where
+code overwrites constants. This is considered an error, however
+for QuakeWorld to compile it needs to be treated as a warning
+instead, as such this warning only works when \-std=qcc.
+.It Fl W Ns Cm directive-inmacro
+Warn about the use of preprocessor directives inside macros.
+.It Fl W Ns Cm builtins
+When using a function that is not explicitly defined, the compiler
+will search its intrinsics table for something that matches that
+function name by appending "__builtin_" to it. This behaviour may
+be unexpected, so enabling this will produce a diagnostic when
+such a function is resolved to a builtin.
+.It Fl W Ns Cm inexact-compares
+When comparing an inexact value such as `1.0/3.0' the result is
+pathologically wrong. Enabling this will trigger a compiler warning
+on such expressions.
 .El
 .Sh COMPILE FLAGS
 .Bl -tag -width Ds
@@ -351,7 +368,7 @@ features used in the Xonotic codebase. If you need more, write a
 ticket.
 .It Fl f Ns Cm ftepp-predefs
 Enable some predefined macros. This only works in combination with
-\'-fftepp' and is currently not included by '-std=fteqcc'. The
+\'\-fftepp' and is currently not included by '\-std=fteqcc'. The
 following macros will be added:
 .Bd -literal -offset indent
 __LINE__
@@ -384,6 +401,26 @@ only the first component will be 0, while the other two will become
 the first to of the global return value. This behavior is odd and
 relying on it should be discouraged, and thus is not supported by
 gmqcc.
+.It Fl f Ns Cm ftepp-mathdefs
+Enable math constant definitions. This only works in combination
+with \'\-fftepp' and is currently not included by '\-std=fteqcc'.
+The following macros will be added:
+.Bd -literal -offset indent
+M_E
+M_LOG2E
+M_LOG10E
+M_LN2
+M_LN10
+M_PI
+M_PI_2
+M_PI_4
+M_1_PI
+M_2_PI
+M_2_SQRTPI
+M_SQRT2
+M_SQRT1_2
+M_TAU
+.Ed
 .It Fl f Ns Cm relaxed-switch
 Allow switch cases to use non constant variables.
 .It Fl f Ns Cm short-logic
@@ -544,6 +581,11 @@ breaks decompilers, but causes the output file to be better compressible.
 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.
+.It Fl f Ns Cm arithmetic-exceptions
+Turn on arithmetic exception tests in the compiler. In constant expressions
+which trigger exceptions like division by zero, overflow, underflow, etc,
+the following flag will produce diagnostics for what triggered that
+exception.
 .El
 .Sh OPTIMIZATIONS
 .Bl -tag -width Ds
@@ -673,7 +715,7 @@ A documented example for a gmqcc.ini file.
 .Sh AUTHOR
 See <http://graphitemaster.github.com/gmqcc>.
 .Sh BUGS
-Currently the '-fftepp-predefs' flag is not included by '-std=fteqcc',
+Currently the '\-fftepp-predefs' flag is not included by '\-std=fteqcc',
 partially because it is not entirely conformant to fteqcc.
 .Pp
 Please report bugs on <http://github.com/graphitemaster/gmqcc/issues>,