PVS-StudioWarnings

PVS-Studio warning V502 for Sanitiser for OpenType

Nov 19th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. bool version_2;
  2.  
  3. bool ots_gdef_parse(....)
  4. {
  5.   ...
  6.   const unsigned gdef_header_end = static_cast<unsigned>(8) +
  7.     gdef->version_2 ? static_cast<unsigned>(2) :
  8.                       static_cast<unsigned>(0);
  9.   ...
  10. }
  11.  
  12. This suspicious code was found in Sanitiser for OpenType project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V502 Perhaps the '?:' operator works in a different way than it was expected. The '?:' operator has a lower priority than the '+' operator. ots gdef.cc 278
  15.  
  16. 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