Is there a way to get VS2008 to stop warning me about unreachable code?

To disable: #pragma warning disable 0162 To restore: #pragma warning restore 0162 For more on #pragma warning, see MSDN. Please note that the C# compiler is optimized enough to not emit unreachable code. This is called dead code elimination and it is one of the few optimizations that the C# compiler performs. And you shouldn’t … Read more

#pragma warning disable & restore

At the very least you should be specific about which warnings you’ve deliberately chosen to ignore. That way, if later maintenance introduces a ‘new’ warning/issue that you should be made aware of, the warning about the newly-introduced error won’t be suppressed by your blanket pragma warning disable directive. You can get the warning numbers pertaining … Read more

Warning From Explicitly Implementing an Interface with Optional Parameters

The problem with optional arguments in C# is whether the callee sees the object as a TestClass or an ITestInterface. In the first case, the values declared in the class apply. In the second case the values declared in the interface apply. It is because the compiler uses the statically available type information to construct … Read more

Fix warning “C-style for Statement is deprecated” in Swift 3

C-style for loop has been deprecated in Swift 3. You can continue using it for a while, but they will certainly disappear in the future. You can rewrite your loop to Swift’s style: for i in 0..<len { let length = UInt32 (letters.length) let rand = arc4random_uniform(length) randomString.appendFormat(“%C”, letters.characterAtIndex(Int(rand))) } Since you don’t use i … Read more

Is there a way to suppress warnings in C# similar to Java’s @SuppressWarnings annotation?

Yes. For disabling, use: #pragma warning disable 0169, 0414, anyothernumber Where the numbers are the identifiers of the warnings that you can read from compiler output. To reenable the warnings after a particular part of code (which is a good idea) use: #pragma warning restore 0169, anythingelse This way you can make the compiler output … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)