Chapter 7. Warnings

Warnings give the programmer information about possible errors in qore code.

Warnings can be enabled using the -W command-line option (see Command-Line Parsing for more information) or by using the %enable-all-warnings or %enable-warningparse directives.

Table 7.1. Warnings

Warning Code

First In

Description

call-with-type-errors

0.8.0

Raised when the parser determines that the argument types of a function or method call are such that the operation is guaranteed to produce a constant value.

deprecated

0.8.0

Raised when deprecated functionality is accessed.

duplicate-block-vars

0.8.2

Raised when a program declares a local variable more than once in the same block; note that this is not a warning but rather an error when %assume-local or %new-style parse options are set.

duplicate-global-vars

0.5.2

Raised when a program declares a global variable more than once.

duplicate-hash-key

0.8.0

Raised when an immediate hash is declared and at least one of the keys is repeated.

duplicate-local-vars

0.5.2

This warning is raised when a local variable with the same name is declared in a subblock (ie another local variable with the same name is reachable in the same lexical scope); note that this warning can raise false positives if the programmer is used to redeclaring the same variable names in subblocks. See also duplicate-block-vars.

excess-args

0.8.0

Raised when a function or method call is made with more arguments than are used by the function or method.

invalid-operation

0.8.0

Raised when the parser determins that the types of an operation are such that the operation is guaranteed to produce no value; this warning can only be raised when type information is available at parse time.

non-existent-method-call

0.8.0

Warning is raised when the given method cannot be found in the class at parse time; this is a warning because the object could be a subclass that has the given method implemented, in which case the call will succeed at run time. Use the cast<>() operator to avoid this warning.

return-value-ignored

0.8.0

Raised when a function or method call is made with no side effects and the return value is ignored.

undeclared-var

0.5.2

This warning is raised when a program uses a variable that has not been declared with my or our.

unknown-warning

0.5.2

This warning is raised when a program tries to enable or disable an unknown warning.

unreachable-code

0.5.2

Raised when code is defined that can never be executed (for example, code following a return or thread_exit statement).

warning-mask-unchanged

0.5.2

This warning is raised when a program tries to change the warning mask with parse options, but the warnings are locked.


There are no comments yet

Leave a Comment



?
? ?
?

 
Powered by TalkBack