PVS-StudioWarnings

PVS-Studio warning V517 for ICU

Nov 17th, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. UnicodeString&
  2. MessageFormat::toPattern(UnicodeString& appendTo) const {
  3.   ...
  4.   else if (formatAlias == *defaultTimeTemplate) {
  5.     appendTo += ID_TIME;
  6.   }
  7.   ...
  8.   else if (formatAlias == *defaultTimeTemplate) {
  9.     appendTo += ID_TIME;
  10.     appendTo += COMMA;
  11.     appendTo += ID_MEDIUM;
  12.   }
  13.   ...
  14. }
  15.  
  16. This suspicious code was found in ICU project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 800, 808. icui18n msgfmt.cpp 800
  19.  
  20. 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