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

C++ Boost: what’s the cause of this warning?

It is nothing to worry about. In the last few releases of MSVC, they’ve gone into full security-paranoia mode. std::copy issues this warning when it is used with raw pointers, because when used incorrectly, it can result in buffer overflows. Their iterator implementation performs bounds checking to ensure this doesn’t happen, at a significant performance … Read more

C# Compiler Warning 1685

Another easy way to verify: In your code, temporarily use the class somewhere. Example: System.Runtime.CompilerServices.ExtensionAttribute x = null; When building, this will generate error: The type ‘System.Runtime.CompilerServices.ExtensionAttribute’ exists in both ‘c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll’ and ….. And show you immediately the 2 sources causing the conflict.

Suppress “discarded non-Unit value” warning

You suppress these warning by explictly returning unit (that is ()). By example turn this: def method1() = { println(“Hello”) “Bye” } def method2() { method1() // Returns “Bye”, which is implicitly discarded } into: def method1() = { println(“Hello”) “Bye” } def method2() { method1() () // Explicitly return unit }

What are the valid characters for macro names?

Macro names should only consist of alphanumeric characters and underscores, i.e. ‘a-z’, ‘A-Z’, ‘0-9’, and ‘_’, and the first character should not be a digit. Some preprocessors also permit the dollar sign character ‘$’, but you shouldn’t use it; unfortunately I can’t quote the C standard since I don’t have a copy of it. From … Read more

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