#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

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

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

C/C++: How to use the do-while(0); construct without compiler warnings like C4127?

Summary: This warning (C4127) in this particular case is a subtle compiler bug. Feel free to disable it. In depth: It was meant to catch situations when logical expression evaluates to a constant in non-obvious situations (such as, if(a==a && a!=a), and somehow, it turned while(true) and other useful constructs into invalid. Microsoft recommends using … Read more

Dynamic forwarding: suppress Incomplete Implementation warning

You can suppress Incomplete Implementation warnings by adding #pragma clang diagnostic ignored “-Wincomplete-implementation” just above the @implementation Hope this helps EDIT After being told in the comments that this didn’t work for someone and finding out the reason was because it was a different warning they were getting I have done a bit of playing … Read more