PVS-StudioWarnings

PVS-Studio warning V653 for Asterisk

Nov 17th, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. static char *token_equivs1[] =
  2. {
  3.   ....
  4.   "KW_IF",
  5.   "KW_IGNOREPAT",
  6.   "KW_INCLUDES"          //<==
  7.   "KW_JUMP",
  8.   "KW_MACRO",
  9.   "KW_PATTERN",
  10.   ....
  11. };
  12.  
  13. static char *ael_token_subst(const char *mess)
  14. {
  15.   ....
  16.   int token_equivs_entries = sizeof(token_equivs1)/sizeof(char*);
  17.   ....
  18.   for (i=0; i<token_equivs_entries; i++) {
  19.     ....
  20.   }
  21.   ....
  22. }
  23.  
  24. This suspicious code was found in Asterisk project by PVS-Studio static code analyzer.
  25. Warning message is:
  26. V653 A suspicious string consisting of two parts is used for array initialization. It is possible that a comma is missing. Consider inspecting this literal: "KW_INCLUDES" "KW_JUMP". ael.y 736
  27.  
  28. 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