PVS-StudioWarnings

PVS-Studio warning V510 for Quake3

Nov 20th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. typedef struct punctuation_s
  2. {
  3.   char *p;
  4.   int n;
  5.   struct punctuation_s *next;
  6. } punctuation_t;
  7.  
  8. punctuation_t *punctuations;
  9.  
  10. int PS_ExpectTokenType(
  11.   script_t *script, int type, int subtype, token_t *token)
  12. {
  13.   ...
  14.   ScriptError(script, "expected %s, found %s",
  15.     script->punctuations[subtype], token->string);
  16.   ...
  17. }
  18.  
  19. This suspicious code was found in Quake3 project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V510 The 'ScriptError' function is not expected to receive class-type variable as third actual argument. botlib l_script.c 992
  22.  
  23. 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