Advertisement
PVS-StudioWarnings

PVS-Studio warning V513 for tesseract-ocr

Nov 10th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. void SVSync::StartThread(void *(*func)(void*), void* arg) {
  2. #ifdef _WIN32
  3.   LPTHREAD_START_ROUTINE f = (LPTHREAD_START_ROUTINE) func;
  4.   DWORD threadid;
  5.   HANDLE newthread = CreateThread(
  6.   NULL,          // default security attributes
  7.   0,             // use default stack size
  8.   f,             // thread function
  9.   arg,           // argument to thread function
  10.   0,             // use default creation flags
  11.   &threadid);    // returns the thread identifier
  12. #else
  13.   pthread_t helper;
  14.   pthread_create(&helper, NULL, func, arg);
  15. #endif
  16. }
  17.  
  18. This suspicious code was found in tesseract-ocr project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V513 Use _beginthreadex/_endthreadex functions instead of CreateThread/ExitThread functions. libtesseract303 svutil.cpp 191
  21.  
  22. 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