This post continues the series of articles, which can well be called “horrors for developers”. This time it will also touch upon a typical pattern of typos related to the usage of numbers 0, 1, 2. The language you’re writing in doesn’t really matter: it can be C, C++, C#, or Java. If you’re using constants 0, 1, 2 or variables’ names contain these numbers, most likely, Freddie will come to visit you at night. Go on, read and don’t say we didn’t warn you.
This issue was found in LibreOffice project. The error is detected by the following diagnostic: V603 The object was created but it is not being used. If you wish to call constructor, ‘this->Guess::Guess(….)’ should be used.
This issue was found in LibreOffice project. The error is detected by the following diagnostic: V509 The ‘dynamic_cast<T&>’ operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. Continue reading
The fragment is taken from LibreOffice project. The error is detected by the following diagnostic: V718 The ‘CreateThread’ function should not be called from ‘DllMain’ function. Continue reading