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 |
|---|---|---|
|
| 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. |
|
| Raised when deprecated functionality is accessed. |
|
| 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. |
|
| Raised when a program declares a global variable more than once. |
|
| Raised when an immediate hash is declared and at least one of the keys is repeated. |
|
| 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. |
|
| Raised when a function or method call is made with more arguments than are used by the function or method. |
|
| 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. |
|
| 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. |
|
| Raised when a function or method call is made with no side effects and the return value is ignored. |
|
| This warning is raised when a program uses a variable that has not been declared with my or our. |
|
| This warning is raised when a program tries to enable or disable an unknown warning. |
|
| Raised when code is defined that can never be executed (for example, code following a return or thread_exit statement). |
|
| 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