simsong / bulk_extractor

This is the development tree. Production downloads are at:
https://github.com/simsong/bulk_extractor/releases
Other
1.08k stars 185 forks source link

Remove ubuntu compile warnings #304

Closed simsong closed 2 years ago

simsong commented 2 years ago

c.f. https://github.com/simsong/bulk_extractor/runs/4438876180?check_suite_focus=true

  CXX      be13_api/sbuf.o
be13_api/sbuf.cpp: In member function ‘size_t sbuf_t::find_ngram_size(size_t) const’:
Warning: be13_api/sbuf.cpp:513:41: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘const size_t’ {aka ‘const long unsigned int’} [-Wsign-compare]
  513 |         for (ngram_size = 1; ngram_size < max_ngram; ngram_size++) {
      |                              ~~~~~~~~~~~^~~~~~~~~~~
In file included from be13_api/sbuf.cpp:17:
be13_api/sbuf.h: In constructor ‘sbuf_t::sbuf_histogram::sbuf_histogram()’:
Warning: be13_api/sbuf.h:230:12: warning: ‘sbuf_t::sbuf_histogram::unique_chars’ should be initialized in the member initialization list [-Weffc++]
  230 |     struct sbuf_histogram {
      |            ^~~~~~~~~~~~~~
be13_api/sbuf.cpp: In member function ‘sbuf_t::sbuf_histogram* sbuf_t::get_histogram() const’:
be13_api/sbuf.cpp:533:40: note: synthesized method ‘sbuf_t::sbuf_histogram::sbuf_histogram()’ first required here
  533 |         histogram = new sbuf_histogram();
      |                                        ^
  CXX      be13_api/sbuf_stream.o
  CXX      be13_api/scan_sha1_test.o
In file included from bulk_extractor.h:10,
                 from main.cpp:9:
Warning: notify_thread.h:15:7: warning: ‘class notify_thread’ has pointer data members [-Weffc++]
   15 | class notify_thread {
      |       ^~~~~~~~~~~~~
Warning: notify_thread.h:15:7: warning:   but does not override ‘notify_thread(const notify_thread&)’ [-Weffc++]
Warning: notify_thread.h:15:7: warning:   or ‘operator=(const notify_thread&)’ [-Weffc++]
  CXXLD    bulk_extractor
  CXX      test_be.o
In file included from bulk_extractor.h:10,
                 from test_be.cpp:30:
Warning: notify_thread.h:15:7: warning: ‘class notify_thread’ has pointer data members [-Weffc++]
   15 | class notify_thread {
      |       ^~~~~~~~~~~~~
Warning: notify_thread.h:15:7: warning:   but does not override ‘notify_thread(const notify_thread&)’ [-Weffc++]
Warning: notify_thread.h:15:7: warning:   or ‘operator=(const notify_thread&)’ [-Weffc++]
  CXX      test_be2.o
In file included from bulk_extractor.h:10,
                 from test_be2.cpp:31:
Warning: notify_thread.h:15:7: warning: ‘class notify_thread’ has pointer data members [-Weffc++]
   15 | class notify_thread {
      |       ^~~~~~~~~~~~~
Warning: notify_thread.h:15:7: warning:   but does not override ‘notify_thread(const notify_thread&)’ [-Weffc++]
Warning: notify_thread.h:15:7: warning:   or ‘operator=(const notify_thread&)’ [-Weffc++]
  CXXLD    test_be