PVS-Studio warning: V504 It is highly probable that the semicolon ‘;’ is missing after ‘return’ keyword. AdvancedSettings.cpp:1476
void CAdvancedSettings::SetExtraArtwork(const TiXmlElement* arttypes,
const TiXmlNode* arttype = arttypes->FirstChild("arttype");
The code formatting suggests the following execution logic:
- if arttypes is a null pointer, the method returns;
- if arttypes is a non-null pointer, the artworkMap vector gets cleared and some actions are then performed.
But the missing ‘;’ character breaks it all, and the actual execution logic is as follows:
- if arttypes is a null pointer, the artworkMap vector gets cleared and the method returns;
- if arttypes is a non-null pointer, the program executes whatever actions come next but the artworkMap vector doesn’t get cleared.
To cut a long story short, this situation does look like a bug. After all, you hardly expect anyone to write expressions like return artworkMap.clear(); :).
Please click here to see more bugs from this project.
Dr. Stark O. Verflo, M.D.
The patient has a broken leg.
Static code analysis is the process of detecting errors and defects in a software’s source code. Static analysis can be viewed as an automated code review process. Let’s speak about the code review now.
As we continue to use more advanced programming languages, we’re able to get some seriously powerful development done with much less code that does increasingly more awesome stuff, but that comes at a price. Since we don’t deal as often with low-level computation and processing anymore, it’s only normal that we don’t always have a full understanding about topics like what the stack is versus the heap, or how compilation really works, or what static vs dynamic typing is, or type introspection, or garbage collection, etc. Now I’m not saying every developer is ignorant of these, as most of us certainly aren’t, but I do feel like it’s worth revisiting some of the old-school important topics that we may miss out on these days.
C# – is an object oriented language of programming, created in 1998–2001 by Microsoft company as a language of application development for Microsoft .NET Framework platform. It combines a strength and flexibility of C++ with a simplicity of Visual Basic. You will find the book pack below, which will help you learn this programming language.
We offer to your attention a series of English articles published on a blog of Jeremy Ruten. You will find in it a detailed description of a development process of own text editor in C.
We often need to store private data in programs, for example passwords, secret keys, and their derivatives, and we usually need to clear their traces in the memory after using them so that a potential intruder can’t gain access to these data. In this article we will discuss why you can’t clear private data using memset() function.
Various devices are often shipped with extremely poor software. And that gets on nerves quite a bit sometimes. However, I’m not going to grumble about that. Instead, I’d like to tell you a funny story to the point.
Many programmers are very fond of blaming the compiler for different errors. Let’s talk about it.
What makes a programmer go to work every day? It is definitely the love for coding and getting pleasure from high quality code. But if a programmer really wants to enjoy coding and appreciation of colleagues, he needs to know some basic things. The author of this article shares secrets of a successful programmer that may be useful for you in the future.