PVS-StudioWarnings

PVS-Studio warning V517 for QT

Nov 20th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. QStringList ProFileEvaluator::Private::values(....)
  2. {
  3.   ...
  4.   else if (ver == QSysInfo::WV_NT)
  5.     ret = QLatin1String("WinNT");
  6.   else if (ver == QSysInfo::WV_2000)
  7.     ret = QLatin1String("Win2000");
  8.   else if (ver == QSysInfo::WV_2000)  <<<--- 2003 !
  9.     ret = QLatin1String("Win2003");
  10.   else if (ver == QSysInfo::WV_XP)
  11.     ret = QLatin1String("WinXP");
  12.   ...
  13. }
  14.  
  15. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 2303, 2305. lrelease profileevaluator.cpp 2303
  18.  
  19. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment