In this section:

Example

This warning is generated whenever a variable is declared, but never actually used. Code is likely problematic, but can still be parsed and analyzed.

CodeDescriptionEnabledReportedPlatform
PARSE_WARNING

Variable declared but never used

(error)CompilationWindows/Unix


Problem

The following code fragment shows an example program that generates PARSE_WARNING:

struct Foo{}
void junk()
{
	Foo;
}

Diagnosis at Runtime

[nothing.cc:5] **PARSE_WARNING**
Parser warning.
>>	 Foo;
declaration does not declare anything
  • Line 1: Source line at which the problem was detected..
  • Line 2: Description of the problem and the expression that is in error.

Repair

Correct the error based on the information presented in the diagnostic output.

  • No labels