pvs-studio Questions

1

Solved

I know that unsigned integers are infamous and generally avoided by C++ devs. I have a class with two int member variables that should not contain negative values: . . . private: int m_Y_AxisLen; ...

4

Solved

For the following snippet: size_t i = 0; std::wstring s; s = (i < 0) ? L"ABC" : L"DEF"; s = (i != -1) ? L"ABC" : L"DEF"; PVS-Studio analysis logs warning for the first condition i < 0, as ...
Pep asked 31/7, 2017 at 8:17

3

Solved

PVS-Studio, the static code analyzer, for the following bit of code size_t const n = 4; int a[n] = {}; reports: V112 Dangerous magic number 4 used: ...t const n = 4;. test.cpp 3 Although PV...
Vidal asked 19/7, 2017 at 15:39
1

© 2022 - 2024 — McMap. All rights reserved.