Diagnostic Messages

Certain constructs may be flagged by the engine as potentially unintended or deprecated. In these cases, the engine will, by default, emit a warning to the log file.
On occasion, these constructs are in fact intended by the script author. In order to avoid unwanted warning messages hiding more important messages, the engine supports selectively suppressing a warning category for parts of a script.
Suppression and re-enablement is handled by the #warning directive. The directive must be placed on a separate line.
Warnings can be controlled using this syntax:
#warning {enable|disable} [warning_category [warning_category...]]
If no category is given, the engine will suppress or enable all messages, including those that are not enabled by default. A category remains disabled or enabled until the next directive that affects it, or until the end of the script. A script linked to via the #include or #appendto directives does not affect, and is itself not affected by, the warning settings of the current script.
It is not an error to specify a category that does not exist; the invalid category is simply ignored. No separate warning is emitted.

Warning Categories

The following warning categories currently exist:
Category Description
The engine found an escape sequence inside a string that it did not recognize.
The engine found the start of a hexadecimal escape sequence inside a string, but no hexadecimal digits followed it.
A function parameter was declared without an explicit type specification, but with a name that is the same as a built-in type.
func f(array)
This warning is not enabled by default. ¹
In a function call, a parameter was left empty. The engine is passing nil in its place.
CreateObject(Clonk,, 30, 100);
This warning is not enabled by default. ¹
In an array literal, an entry was left empty. The engine is using nil in its place.
[1, 2,, 3, 4]
This warning is not enabled by default. ¹
The loop variable of a for-in loop was not declared either in the loop header itself nor in the containing function. This is only accepted for backwards compatibility and may be removed in a future release. Explicitly declare the variable by adding the var keyword.
func f() {
	for (i in [1, 2, 3]) {
A variable has been declared as const, but is not global. At this time, non-global variables are always mutable.
const local a = {}
The declaration of a variable uses the same name as a variable in a greater scope. Changes to the shadowing variable will not affect the shadowed variable.
static foo;
func f() {
	var foo = 3;
A variable has been redeclared in the same scope. Make sure you do not accidentally overwrite values another part of the code relies upon.
func f() {
	var i;
	var i;
A variable has been used outside of the block it has been declared in. This is accepted only for backwards compatibility and may be removed in a future release.
func f(a) {
	i = 0;
	if (a) {
		var i = 1;
	return i;
Use of Par inside a function implicitly declares it as using a variable number of arguments. This is not immediately obvious to callers of the function, and should be explicitly declared in the function signature by adding a final ... parameter.
func f(a) {
	return Par(a);
// Better:
func g(a, ...) {
	return Par(a);
A function call passes more parameters than the function will accept.
The parameter given in a function call is of a different type than the called function expects. The call will likely fail at runtime.
An if conditional is controlling an empty statement. Use the empty block {} if this is intentional, or remove the conditional entirely.
if (true);
An assignment was found where an expression was expected. While an assignment returns its own value, usually a comparison was intended instead.
if (a = b + 1) { /* Do something */}
If the assignment is intentional, make this more obvious by extracting it to a separate statement, or explicitly handle the boolean conversion by adding a comparison operator.


func f(string s) {
	Sin(s);	// WARNING: parameter 0 of call to 'Sin' passes string (int expected)
#warning disable arg_type_mismatch
#warning enable arg_type_mismatch
	Sin(s);	// WARNING: parameter 0 of call to 'Sin' passes string (int expected)
¹ The warning may be enabled by default in a future version.