BoboTiG / cracker-ng

ZIP cracker, CCRYPT cracker, and others to come.
GNU General Public License v2.0
90 stars 10 forks source link

Doesn't compile #8

Closed FalcoGer closed 2 years ago

FalcoGer commented 2 years ago

This doesn't compile, because it throws an error

make cpt
 + Building cpt module ...
make -C src/ cpt clean DEBUG=0
make[1]: Entering directory '[...]/cracker-ng/src'
g++ -O3 -ffast-math -march=native -D_FILE_OFFSET_BITS=64 -Wfatal-errors -Werror -Wall -W -pedantic -Wextra -Wunused -Wformat=2 -Weffc++ -Wpadded -fexceptions -c shared/functions.cc -o cptfunctions.o -DCPT
g++ -O3 -ffast-math -march=native -D_FILE_OFFSET_BITS=64 -Wfatal-errors -Werror -Wall -W -pedantic -Wextra -Wunused -Wformat=2 -Weffc++ -Wpadded -fexceptions -c cpt/rijndael.cc
g++ -O3 -ffast-math -march=native -D_FILE_OFFSET_BITS=64 -Wfatal-errors -Werror -Wall -W -pedantic -Wextra -Wunused -Wformat=2 -Weffc++ -Wpadded -fexceptions -c cpt/tables.cc
g++ -O3 -ffast-math -march=native -D_FILE_OFFSET_BITS=64 -Wfatal-errors -Werror -Wall -W -pedantic -Wextra -Wunused -Wformat=2 -Weffc++ -Wpadded -fexceptions -c shared/stats.cc
g++ -O3 -ffast-math -march=native -D_FILE_OFFSET_BITS=64 -Wfatal-errors -Werror -Wall -W -pedantic -Wextra -Wunused -Wformat=2 -Weffc++ -Wpadded -fexceptions -c shared/gui.cc
g++ -O3 -ffast-math -march=native -D_FILE_OFFSET_BITS=64 -Wfatal-errors -Werror -Wall -W -pedantic -Wextra -Wunused -Wformat=2 -Weffc++ -Wpadded -fexceptions -c shared/cracker.cc -o cptcracker.o -DCPT
In file included from shared/cracker.cc:13:
shared/./cracker.h: In member function ‘size_t Cracker::istrlen(const char*)’:
shared/./cracker.h:73:33: error: ISO C++17 does not allow ‘register’ storage class specifier [-Werror=register]
   73 |                 register size_t len = 0;
      |                                 ^~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:42: cptcracker.o] Error 1
make[1]: Leaving directory '[...]/cracker-ng/src'
make: *** [Makefile:21: cpt] Error 2

Fix:

diff --git a/src/shared/cracker.h b/src/shared/cracker.h
index 9bf64ec..1b76c12 100644
--- a/src/shared/cracker.h
+++ b/src/shared/cracker.h
@@ -70,8 +70,8 @@ private:
        Cracker & operator=(const Cracker &);

        inline size_t istrlen(const char *s) {
-               register size_t len = 0;
-               register unsigned x;
+               size_t len = 0;
+               unsigned x;
                for( ;; ) {
                        x = *(unsigned*)s;
                        if ( (x & 0xFF) == 0 ) return len;