simsong / bulk_extractor

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

Errors building with gcc-11 #281

Closed thinrope closed 3 years ago

thinrope commented 3 years ago

Trying to compile 2.0.0-beta1 with gcc-11.2.0 throws a few errors about byte ... Working on a patch for those...

scan_rar.cpp: In function ‘void unpack_buf(const uint8_t*, size_t, uint8_t*, size_t)’:
scan_rar.cpp:542:5: error: reference to ‘byte’ is ambiguous
  542 |     byte *startingaddress = (byte*) input;
      |     ^~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/bits/stl_algobase.h:61,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/bits/char_traits.h:39,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/string:40,
                 from be13_api/sbuf.h:54,
                 from be13_api/bulk_extractor_i.h:84,
                 from scan_rar.cpp:4:
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/bits/cpp_type_traits.h:404:30: note: candidates are: ‘enum class std::byte’
  404 |   enum class byte : unsigned char;
      |                              ^~~~
In file included from rar/rar.hpp:20,
                 from scan_rar.cpp:16:
rar/rartypes.hpp:4:26: note:                 ‘typedef unsigned char byte’
    4 | typedef unsigned char    byte;   // unsigned 8 bits
      |                          ^~~~
scan_rar.cpp:542:11: error: ‘startingaddress’ was not declared in this scope
  542 |     byte *startingaddress = (byte*) input;
      |           ^~~~~~~~~~~~~~~
scan_rar.cpp:542:30: error: reference to ‘byte’ is ambiguous
  542 |     byte *startingaddress = (byte*) input;
      |                              ^~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/bits/stl_algobase.h:61,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/bits/char_traits.h:39,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/string:40,
                 from be13_api/sbuf.h:54,
                 from be13_api/bulk_extractor_i.h:84,
                 from scan_rar.cpp:4:
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/bits/cpp_type_traits.h:404:30: note: candidates are: ‘enum class std::byte’
  404 |   enum class byte : unsigned char;
      |                              ^~~~
In file included from rar/rar.hpp:20,
                 from scan_rar.cpp:16:
rar/rartypes.hpp:4:26: note:                 ‘typedef unsigned char byte’
    4 | typedef unsigned char    byte;   // unsigned 8 bits
      |                          ^~~~
scan_rar.cpp:542:35: error: expected primary-expression before ‘)’ token
  542 |     byte *startingaddress = (byte*) input;
      |                                   ^
make[2]: *** [Makefile:1050: scan_rar.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/tmp/portage/app-forensics/bulk_extractor-2.0.0_beta1/work/bulk_extractor-2.0.0_beta1/src'
make[1]: *** [Makefile:466: all-recursive] Error 1
make[1]: Leaving directory '/tmp/portage/app-forensics/bulk_extractor-2.0.0_beta1/work/bulk_extractor-2.0.0_beta1'
make: *** [Makefile:405: all] Error 2
simsong commented 3 years ago

that's odd. I thought I had fixed it...

simsong commented 3 years ago

Looks like I had not fixed this. I will change byte to uint8_t.

simsong commented 3 years ago

I'll have a fix shortly. If you want to work on something, what would be really great would be moving this over to libarchive to get support for RAR4 and RAR5.

thinrope commented 3 years ago

LoL, just saw your comments :-D