Compiler Warning (level 3) CS0642
Possible mistaken empty statement
A semicolon after a conditional statement may cause your code to execute differently than intended.
You can use NoWarn compiler option or #pragmas warning
to disable this warning; see NoWarn (C# Compiler Options) or #pragma warning for more information.
The following sample generates CS0642:
// CS0642.cs
// compile with: /W:3
class MyClass
{
public static void Main()
{
int i;
for (i = 0; i < 10; i += 1); // CS0642 semicolon intentional?
{
System.Console.WriteLine (i);
}
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: