PVS-StudioWarnings

PVS-Studio warning V510 for webem

Nov 13th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. wstring myDBFName;
  2. ...
  3. void CSQLiteDatabase::Open()
  4. {
  5.   int rc = sqlite3_open16(myDBFName.c_str(), &db);
  6.   if( rc ) {
  7.     printf("Cannot open database %s",myDBFName);
  8.     exit(1);
  9.   }
  10. }
  11.  
  12. 1) wprintf should be used. 2) .c_str() is missing.
  13.  
  14. This suspicious code was found in webem project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V510 The 'printf' function is not expected to receive class-type variable as second actual argument. Examples SQLiteDatabase.cpp 39
  17.  
  18. 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