Advertisement
PVS-StudioWarnings

PVS-Studio warning V670 for tesseract-ocr

Nov 25th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.14 KB | None | 0 0
  1. class MasterTrainer {
  2.   ....
  3.   TrainingSampleSet samples_;
  4.   ....
  5.   FontInfoTable fontinfo_table_;
  6.   ....
  7. };
  8.  
  9. MasterTrainer::MasterTrainer(NormalizationMode norm_mode,
  10.                              bool shape_analysis,
  11.                              bool replicate_samples,
  12.                              int debug_level)
  13.   : norm_mode_(norm_mode),
  14.     samples_(fontinfo_table_),
  15.     junk_samples_(fontinfo_table_),
  16.     verify_samples_(fontinfo_table_),
  17.     charsetsize_(0),
  18.     enable_shape_anaylsis_(shape_analysis),
  19.     enable_replication_(replicate_samples),
  20.     fragments_(NULL), prev_unichar_id_(-1),
  21.     debug_level_(debug_level) {
  22. }
  23.  
  24. This suspicious code was found in tesseract-ocr project by PVS-Studio static code analyzer.
  25. Warning message is:
  26. V670 The uninitialized class member 'fontinfo_table_' is used to initialize the 'samples_' member. Remember that members are initialized in the order of their declarations inside a class. libtesseract303 mastertrainer.cpp 58
  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
Advertisement