Advertisement
PVS-StudioWarnings

PVS-Studio warning V556 for TortoiseGIT

Nov 26th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. static enum {
  2.   ABORT, VERBATIM, WARN, WARN_STRIP, STRIP
  3. } signed_tag_mode = ABORT;
  4.  
  5. static enum {
  6.   ERROR, DROP, REWRITE
  7. } tag_of_filtered_mode = ERROR;
  8.  
  9. static void handle_tag(const char *name, struct tag *tag)
  10. {
  11.   ....
  12.   switch(tag_of_filtered_mode) {
  13.   case ABORT:
  14.   ....
  15. }
  16.  
  17. This suspicious code was found in TortoiseGIT project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V556 The values of different enum types are compared: switch(ENUM_TYPE_A) { case ENUM_TYPE_B: ... }. fast-export.c 449
  20.  
  21. 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
Advertisement