\doxysection{Warnings}
\hypertarget{warnings}{}\label{warnings}\index{Warnings@{Warnings}}
Warnings give the programmer information about possible errors in Qore code.

Warnings can be enabled using the {\ttfamily -\/W} command-\/line option (see \doxylink{command_line_processing}{qore Executable Command-\/\+Line Processing} for more information) or by using the \doxysectlink{parse_directives_enable-all-warnings}{\%enable-\/all-\/warnings}{1} or \doxysectlink{parse_directives_enable-warning}{\%enable-\/warning}{1} 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 \doxysectlink{warnings_warning-broken-logic-precedence}{broken-\/logic-\/precedence}{1} broken-\/logic-\/precedence
\item \doxysectlink{warnings_call-with-type-errors}{call-\/with-\/type-\/errors}{1}
\item \doxysectlink{warnings_deprecated-warning}{deprecated}{1}
\item \doxysectlink{warnings_duplicate-block-vars}{duplicate-\/block-\/vars}{1}
\item \doxysectlink{warnings_duplicate-global-vars}{duplicate-\/global-\/vars}{1}
\item \doxysectlink{warnings_duplicate-hash-key}{duplicate-\/hash-\/key}{1}
\item \doxysectlink{warnings_duplicate-local-vars}{duplicate-\/local-\/vars}{1}
\item \doxysectlink{warnings_excess-args}{excess-\/args}{1}
\item \doxysectlink{warnings_invalid-catch}{invalid-\/catch}{1}
\item \doxysectlink{warnings_invalid-operation}{invalid-\/operation}{1}
\item \doxysectlink{warnings_module-only}{module-\/only}{1}
\item \doxysectlink{warnings_non-existent-method-call}{non-\/existent-\/method-\/call}{1}
\item \doxysectlink{warnings_return-value-ignored}{return-\/value-\/ignored}{1}
\item \doxysectlink{warnings_undeclared-var}{undeclared-\/var}{1}
\item \doxysectlink{warnings_unknown-warning}{unknown-\/warning}{1}
\item \doxysectlink{warnings_unreachable-code}{unreachable-\/code}{1}
\item \doxysectlink{warnings_unreferenced-variable}{unreferenced-\/variable}{1}
\item \doxysectlink{warnings_warning-mask-unchanged}{warning-\/mask-\/unchanged}{1}
\end{DoxyItemize}
\end{DoxyParagraph}
\DoxyHorRuler{0}
 \hypertarget{warnings_warning-broken-logic-precedence}{}\doxysubsection{\texorpdfstring{broken-\/logic-\/precedence}{broken-logic-precedence}}\label{warnings_warning-broken-logic-precedence}
Only available with \doxysectlink{parse_directives_broken-logic-precedence}{\%broken-\/logic-\/precedence}{1} parse define. Raised when the parser determins that meaning of an expression is affected by the \doxysectlink{parse_directives_broken-logic-precedence}{\%broken-\/logic-\/precedence}{1} parse define.

\begin{DoxySince}{Since}
Qore 0.\+8.\+12.\+11
\end{DoxySince}
\DoxyHorRuler{0}
 \hypertarget{warnings_call-with-type-errors}{}\doxysubsection{\texorpdfstring{call-\/with-\/type-\/errors}{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}{}\doxysubsection{\texorpdfstring{deprecated}{deprecated}}\label{warnings_deprecated-warning}
Raised when deprecated functionality is accessed. \begin{DoxySeeAlso}{See also}
\doxysectlink{deprecated}{Deprecated List}{0} 
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+0
\end{DoxySince}
\DoxyHorRuler{0}
 \hypertarget{warnings_duplicate-block-vars}{}\doxysubsection{\texorpdfstring{duplicate-\/block-\/vars}{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 \doxysectlink{parse_directives_assume-local}{\%assume-\/local}{1} or \doxysectlink{parse_directives_new-style}{\%new-\/style}{1} parse options are set \begin{DoxySince}{Since}
Qore 0.\+8.\+2
\end{DoxySince}
\DoxyHorRuler{0}
 \hypertarget{warnings_duplicate-global-vars}{}\doxysubsection{\texorpdfstring{duplicate-\/global-\/vars}{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}{}\doxysubsection{\texorpdfstring{duplicate-\/hash-\/key}{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}{}\doxysubsection{\texorpdfstring{duplicate-\/local-\/vars}{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}
\doxysectlink{warnings_duplicate-block-vars}{duplicate-\/block-\/vars}{1} 
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+5.\+2
\end{DoxySince}
\DoxyHorRuler{0}
 \hypertarget{warnings_excess-args}{}\doxysubsection{\texorpdfstring{excess-\/args}{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}{}\doxysubsection{\texorpdfstring{invalid-\/catch}{invalid-catch}}\label{warnings_invalid-catch}
Raised when a \doxysectlink{statements_try}{catch block}{1} exception variable has no type declaration, but types are required \begin{DoxySince}{Since}
Qore 1.\+0
\end{DoxySince}
\DoxyHorRuler{0}
 \hypertarget{warnings_invalid-operation}{}\doxysubsection{\texorpdfstring{invalid-\/operation}{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}{}\doxysubsection{\texorpdfstring{module-\/only}{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 \doxysectlink{qore_modules_mod_public}{The "{}public"{} Keyword}{2} \begin{DoxySince}{Since}
Qore 0.\+8.\+4
\end{DoxySince}
\DoxyHorRuler{0}
 \hypertarget{warnings_non-existent-method-call}{}\doxysubsection{\texorpdfstring{non-\/existent-\/method-\/call}{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 \doxysectlink{operators_cast}{cast\texorpdfstring{$<$}{<}\texorpdfstring{$>$}{>}() operator}{2} to avoid this warning \begin{DoxySince}{Since}
Qore 0.\+8.\+0
\end{DoxySince}
\DoxyHorRuler{0}
 \hypertarget{warnings_return-value-ignored}{}\doxysubsection{\texorpdfstring{return-\/value-\/ignored}{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}{}\doxysubsection{\texorpdfstring{undeclared-\/var}{undeclared-var}}\label{warnings_undeclared-var}
This warning is raised when a program uses a variable that has not been declared with \doxysectlink{variables_my}{my}{2} or \doxysectlink{variables_our}{our}{2} \begin{DoxySince}{Since}
Qore 0.\+5.\+2
\end{DoxySince}
\DoxyHorRuler{0}
 \hypertarget{warnings_unknown-warning}{}\doxysubsection{\texorpdfstring{unknown-\/warning}{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}{}\doxysubsection{\texorpdfstring{unreachable-\/code}{unreachable-code}}\label{warnings_unreachable-code}
Raised when code is defined that can never be executed (for example, code following a \doxysectlink{statements_return}{return}{1} or \doxysectlink{statements_thread_exit}{thread\+\_\+exit statement}{1}) \begin{DoxySince}{Since}
Qore 0.\+5.\+2
\end{DoxySince}
\DoxyHorRuler{0}
 \hypertarget{warnings_unreferenced-variable}{}\doxysubsection{\texorpdfstring{unreferenced-\/variable}{unreferenced-variable}}\label{warnings_unreferenced-variable}
Raised when a variable is declared but never referenced as long as the variable cannot hold an object. Variables holding objects can be used to release resources in the class destructor when they go out of scope. \begin{DoxySince}{Since}
Qore 0.\+8.\+2
\end{DoxySince}
\DoxyHorRuler{0}
 \hypertarget{warnings_warning-mask-unchanged}{}\doxysubsection{\texorpdfstring{warning-\/mask-\/unchanged}{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}
