1
General discussions / static analysis of SFML
« on: April 11, 2015, 12:37:36 am »
Hello,
as a test, I've tried PVS-Studio on SFML (master) and, considering I did it correctly, there is not many things to say (which is a good thing).
Except the missing operator=(), the rest can be "forgotten" since it's mainly syntax choices¹ (but why the double assignment?)
++
¹: I know C-casts are discouraged, but with C structs and function, the static_cast should "win".
as a test, I've tried PVS-Studio on SFML (master) and, considering I did it correctly, there is not many things to say (which is a good thing).
- Most of the output was about c-style casts (mainly in glloader.cpp).
- Several "variable assigned twice", like:
sfogl_StrToExtMap *entry = NULL;
entry = FindExtEntry(extensionName);
entry = FindExtEntry(extensionName);
- "The '(FT_RENDER_MODE_NORMAL)' named constant with the value of 0 is used in the bitwise operation. font.cpp:485"
- SoundSource has a copy constructor but no assignment operator.
- And a few about optimization, like : use !string.empty() instead of string != "".
- Last, an UB in stb_image.h. There are bitwise shifts on negative numbers.
Except the missing operator=(), the rest can be "forgotten" since it's mainly syntax choices¹ (but why the double assignment?)
++
¹: I know C-casts are discouraged, but with C structs and function, the static_cast should "win".