Warnings give the programmer information about possible errors in Qore code. Warnings can be enabled using the {\ttfamily -\/W} command-\/line option (see \mbox{\hyperlink{command_line_processing}{qore Executable Command-\/\+Line Processing}} for more information) or by using the \mbox{\hyperlink{parse_directives_enable-all-warnings}{\%enable-\/all-\/warnings}} or \mbox{\hyperlink{parse_directives_enable-warning}{\%enable-\/warning}} parse directives. \begin{DoxyParagraph}{Command Line Example} \begin{DoxyVerb}prompt$ qore -wdeprecated -wduplicate-hash-key script.q\end{DoxyVerb} \end{DoxyParagraph} \begin{DoxyParagraph}{Qore Code Example} \begin{DoxyCode}{0} \DoxyCodeLine{\%enable-\/warning deprecated} \DoxyCodeLine{\%enable-\/warning duplicate-\/hash-\/key} \DoxyCodeLine{\%disable-\/warning excess-\/args} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParagraph}{List of All Warnings} \begin{DoxyItemize} \item \mbox{\hyperlink{warnings_warning-broken-logic-precedence}{broken-\/logic-\/precedence}} broken-\/logic-\/precedence \item \mbox{\hyperlink{warnings_call-with-type-errors}{call-\/with-\/type-\/errors}} \item \mbox{\hyperlink{warnings_deprecated-warning}{deprecated}} \item \mbox{\hyperlink{warnings_duplicate-block-vars}{duplicate-\/block-\/vars}} \item \mbox{\hyperlink{warnings_duplicate-global-vars}{duplicate-\/global-\/vars}} \item \mbox{\hyperlink{warnings_duplicate-hash-key}{duplicate-\/hash-\/key}} \item \mbox{\hyperlink{warnings_duplicate-local-vars}{duplicate-\/local-\/vars}} \item \mbox{\hyperlink{warnings_excess-args}{excess-\/args}} \item \mbox{\hyperlink{warnings_invalid-catch}{invalid-\/catch}} \item \mbox{\hyperlink{warnings_invalid-operation}{invalid-\/operation}} \item \mbox{\hyperlink{warnings_module-only}{module-\/only}} \item \mbox{\hyperlink{warnings_non-existent-method-call}{non-\/existent-\/method-\/call}} \item \mbox{\hyperlink{warnings_return-value-ignored}{return-\/value-\/ignored}} \item \mbox{\hyperlink{warnings_undeclared-var}{undeclared-\/var}} \item \mbox{\hyperlink{warnings_unknown-warning}{unknown-\/warning}} \item \mbox{\hyperlink{warnings_unreachable-code}{unreachable-\/code}} \item \mbox{\hyperlink{warnings_unreferenced-variable}{unreferenced-\/variable}} \item \mbox{\hyperlink{warnings_warning-mask-unchanged}{warning-\/mask-\/unchanged}} \end{DoxyItemize} \end{DoxyParagraph} \DoxyHorRuler{0} \hypertarget{warnings_warning-broken-logic-precedence}{}\doxysection{broken-\/logic-\/precedence}\label{warnings_warning-broken-logic-precedence} Only available with \mbox{\hyperlink{parse_directives_broken-logic-precedence}{\%broken-\/logic-\/precedence}} parse define. Raised when the parser determins that meaning of an expression is affected by the \mbox{\hyperlink{parse_directives_broken-logic-precedence}{\%broken-\/logic-\/precedence}} parse define. \begin{DoxySince}{Since} Qore 0.\+8.\+12.\+11 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_call-with-type-errors}{}\doxysection{call-\/with-\/type-\/errors}\label{warnings_call-with-type-errors} 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 \begin{DoxySince}{Since} Qore 0.\+8.\+0 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_deprecated-warning}{}\doxysection{deprecated}\label{warnings_deprecated-warning} Raised when deprecated functionality is accessed. \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{deprecated}{Deprecated List}} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+0 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_duplicate-block-vars}{}\doxysection{duplicate-\/block-\/vars}\label{warnings_duplicate-block-vars} 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 \mbox{\hyperlink{parse_directives_assume-local}{\%assume-\/local}} or \mbox{\hyperlink{parse_directives_new-style}{\%new-\/style}} parse options are set \begin{DoxySince}{Since} Qore 0.\+8.\+2 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_duplicate-global-vars}{}\doxysection{duplicate-\/global-\/vars}\label{warnings_duplicate-global-vars} Raised when a program declares a global variable more than once \begin{DoxySince}{Since} Qore 0.\+5.\+2 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_duplicate-hash-key}{}\doxysection{duplicate-\/hash-\/key}\label{warnings_duplicate-hash-key} Raised when an immediate hash is declared and at least one of the keys is repeated \begin{DoxySince}{Since} Qore 0.\+8.\+0 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_duplicate-local-vars}{}\doxysection{duplicate-\/local-\/vars}\label{warnings_duplicate-local-vars} 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 \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{warnings_duplicate-block-vars}{duplicate-\/block-\/vars}} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+5.\+2 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_excess-args}{}\doxysection{excess-\/args}\label{warnings_excess-args} Raised when a function or method call is made with more arguments than are used by the function or method \begin{DoxySince}{Since} Qore 0.\+8.\+0 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_invalid-catch}{}\doxysection{invalid-\/catch}\label{warnings_invalid-catch} Raised when a \mbox{\hyperlink{statements_try}{catch block}} exception variable has no type declaration, but types are required \begin{DoxySince}{Since} Qore 1.\+0 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_invalid-operation}{}\doxysection{invalid-\/operation}\label{warnings_invalid-operation} 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 \begin{DoxySince}{Since} Qore 0.\+8.\+0 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_module-only}{}\doxysection{module-\/only}\label{warnings_module-only} This warning is raised when a feature that is only valid in a user module is used in code that is not in a user module, for example, declaring a class or namespace \mbox{\hyperlink{qore_modules_mod_public}{The \char`\"{}public\char`\"{} Keyword}} \begin{DoxySince}{Since} Qore 0.\+8.\+4 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_non-existent-method-call}{}\doxysection{non-\/existent-\/method-\/call}\label{warnings_non-existent-method-call} 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 \mbox{\hyperlink{operators_cast}{cast$<$$>$() operator}} to avoid this warning \begin{DoxySince}{Since} Qore 0.\+8.\+0 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_return-value-ignored}{}\doxysection{return-\/value-\/ignored}\label{warnings_return-value-ignored} Raised when a function or method call is made with no side effects and the return value is ignored \begin{DoxySince}{Since} Qore 0.\+8.\+0 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_undeclared-var}{}\doxysection{undeclared-\/var}\label{warnings_undeclared-var} This warning is raised when a program uses a variable that has not been declared with \mbox{\hyperlink{variables_my}{my}} or \mbox{\hyperlink{variables_our}{our}} \begin{DoxySince}{Since} Qore 0.\+5.\+2 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_unknown-warning}{}\doxysection{unknown-\/warning}\label{warnings_unknown-warning} This warning is raised when a program tries to enable or disable an unknown warning \begin{DoxySince}{Since} Qore 0.\+5.\+2 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_unreachable-code}{}\doxysection{unreachable-\/code}\label{warnings_unreachable-code} Raised when code is defined that can never be executed (for example, code following a \mbox{\hyperlink{statements_return}{return}} or \mbox{\hyperlink{statements_thread_exit}{thread\+\_\+exit statement}}) \begin{DoxySince}{Since} Qore 0.\+5.\+2 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_unreferenced-variable}{}\doxysection{unreferenced-\/variable}\label{warnings_unreferenced-variable} Raised when a variable is declared but never referenecd \begin{DoxySince}{Since} Qore 0.\+8.\+2 \end{DoxySince} \DoxyHorRuler{0} \hypertarget{warnings_warning-mask-unchanged}{}\doxysection{warning-\/mask-\/unchanged}\label{warnings_warning-mask-unchanged} This warning is raised when a program tries to change the warning mask with parse options, but the warnings are locked \begin{DoxySince}{Since} Qore 0.\+5.\+2 \end{DoxySince}