Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly new warnings when compiling with GCC 6 #2086

Closed
kholia opened this issue Mar 12, 2016 · 6 comments
Closed

Possibly new warnings when compiling with GCC 6 #2086

kholia opened this issue Mar 12, 2016 · 6 comments

Comments

@kholia
Copy link
Member

kholia commented Mar 12, 2016

$ git rev-parse --short HEAD
95f75a2
$ ./configure
...
Configured for building John the Ripper jumbo:

Target CPU ................................. x86_64 SSE4.1, 64-bit LE
AES-NI support ............................. run-time detection
Target OS .................................. linux-gnu
Cross compiling ............................ no
Legacy arch header ......................... x86-64.h

Optional libraries/features found:
Fuzzing test ............................... no
Experimental code .......................... no
OpenMPI support (default disabled) ......... no
Fork support ............................... yes
OpenMP support ............................. yes (not for fast formats)
CUDA support (default disabled by OpenCL) .. no
OpenCL support ............................. no
Generic crypt(3) format .................... yes
Rexgen (extra cracking mode) ............... no
GMP (PRINCE mode and faster SRP formats) ... yes
PCAP (vncpcap2john and SIPdump) ............ no
Z (pkzip format, gpg2john) ................. yes
BZ2 (gpg2john extra decompression logic) ... no
128-bit integer (faster PRINCE mode) ....... yes
Memory map (share/page large files) ........ yes

Development options (these may hurt performance when enabled):
Memdbg memory debugging settings ........... disabled
AddressSanitizer ("ASan") .................. disabled
UndefinedBehaviorSanitizer ("UbSan") ....... disabled

Install missing libraries to get any needed features that were omitted.

Configure finished.  Now 'make clean && make -s' to compile.
$ make >/dev/null 2>warn.log
...

$ cat warn.log
In file included from MD5_fmt.c:21:0:
cryptmd5_common.h:9:19: warning: ‘smd5_salt_prefix’ defined but not used [-Wunused-const-variable]
 static const char smd5_salt_prefix[] = "{smd5}";
                   ^~~~~~~~~~~~~~~~
cryptmd5_common.h:8:19: warning: ‘apr1_salt_prefix’ defined but not used [-Wunused-const-variable]
 static const char apr1_salt_prefix[] = "$apr1$";
                   ^~~~~~~~~~~~~~~~
cryptmd5_common.h:7:19: warning: ‘md5_salt_prefix’ defined but not used [-Wunused-const-variable]
 static const char md5_salt_prefix[] = "$1$";
                   ^~~~~~~~~~~~~~~
hmailserver_fmt_plug.c: In function ‘hmailserver_valid’:
hmailserver_fmt_plug.c:112:2: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
  get_ptr();
  ^~~~~~~
hmailserver_fmt_plug.c:109:5: note: ...this ‘if’ clause, but it is not
     if ( ciphertext == NULL )
     ^~
pkzip_fmt_plug.c: In function ‘check_inflate_CODE2’:
pkzip_fmt_plug.c:1159:2: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
  return 1;   /* Passed this check! */
  ^~~~~~
pkzip_fmt_plug.c:1156:5: note: ...this ‘if’ clause, but it is not
     if (left > 0)
     ^~
In file included from mask.c:34:0:
encoding_data.h:1183:20: warning: ‘CP1256_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1256_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:1123:20: warning: ‘CP1255_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1255_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:1062:20: warning: ‘CP1254_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1254_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:1001:20: warning: ‘CP1253_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1253_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:940:20: warning: ‘CP1252_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1252_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:881:20: warning: ‘CP1251_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1251_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:820:20: warning: ‘CP1250_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1250_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:768:20: warning: ‘CP868_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP868_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:708:20: warning: ‘CP866_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP866_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:648:20: warning: ‘CP858_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP858_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:587:20: warning: ‘CP852_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP852_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:526:20: warning: ‘CP850_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP850_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:466:20: warning: ‘CP737_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP737_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:408:20: warning: ‘CP720_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP720_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:349:20: warning: ‘CP437_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP437_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:289:20: warning: ‘KOI8_R_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 KOI8_R_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:229:20: warning: ‘ISO_8859_15_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 ISO_8859_15_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:167:20: warning: ‘ISO_8859_7_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 ISO_8859_7_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:106:20: warning: ‘ISO_8859_2_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 ISO_8859_2_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:46:20: warning: ‘ISO_8859_1_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 ISO_8859_1_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
options.c: In function ‘opt_init’:
options.c:713:6: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
      if (negative && options.loader.min_cost[i] == 0) {
      ^~
options.c:711:5: note: ...this ‘if’ clause, but it is not
     if (!two_values)
     ^~
In file included from rules.c:24:0:
encoding_data.h:1183:20: warning: ‘CP1256_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1256_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:1123:20: warning: ‘CP1255_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1255_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:1062:20: warning: ‘CP1254_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1254_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:1001:20: warning: ‘CP1253_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1253_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:940:20: warning: ‘CP1252_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1252_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:881:20: warning: ‘CP1251_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1251_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:820:20: warning: ‘CP1250_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP1250_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:768:20: warning: ‘CP868_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP868_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:708:20: warning: ‘CP866_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP866_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:648:20: warning: ‘CP858_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP858_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:587:20: warning: ‘CP852_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP852_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:526:20: warning: ‘CP850_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP850_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:466:20: warning: ‘CP737_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP737_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:408:20: warning: ‘CP720_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP720_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:349:20: warning: ‘CP437_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 CP437_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:289:20: warning: ‘KOI8_R_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 KOI8_R_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:229:20: warning: ‘ISO_8859_15_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 ISO_8859_15_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:167:20: warning: ‘ISO_8859_7_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 ISO_8859_7_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:106:20: warning: ‘ISO_8859_2_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 ISO_8859_2_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encoding_data.h:46:20: warning: ‘ISO_8859_1_to_unicode_high128’ defined but not used [-Wunused-const-variable]
 static const UTF16 ISO_8859_1_to_unicode_high128[] = {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ar: creating aes.a
$ gcc --version
gcc (GCC) 6.0.0 20160212 (Red Hat 6.0.0-0.11)
@magnumripper
Copy link
Member

I think the "only" fix is to simply add -Wno-unused-const-variable to certain files (like unicode.c).

@magnumripper
Copy link
Member

Hmm or maybe rules.c and mask.c should not source encoding_data.h at all. Does that happen via unicode.h? Perhaps we can move some things around.

@kholia
Copy link
Member Author

kholia commented Jul 19, 2016

@magnumripper the following seems to be a valid warning, simply de-indenting the "if block" should get rid of this warning.

$ gcc --version
gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3)
Copyright (C) 2016 Free Software Foundation, Inc.
...
gcc -DAC_BUILT -march=native -mavx2 -DJOHN_AVX2 -c -g -O2 -I/usr/local/include -DARCH_LITTLE_ENDIAN=1   -Wall -Wdeclaration-after-statement -fomit-frame-pointer --param allow-store-data-races=0 -Wno-deprecated-declarations  -Wunused-but-set-variable -std=gnu89 -Wdate-time -D_POSIX_SOURCE -D_GNU_SOURCE -D_XOPEN_SOURCE=600    -fopenmp  -pthread -DHAVE_HT  -I/usr/local/include -funroll-loops options.c -o options.o
options.c: In function ‘opt_init’:
options.c:706:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (!two_values)
     ^~
options.c:708:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
      if (negative && options.loader.min_cost[i] == 0) {
      ^~

Opened #2177 to fix this.

magnumripper added a commit that referenced this issue Aug 17, 2016
@magnumripper
Copy link
Member

@kholia does 5f0a6fc help a little?

@magnumripper
Copy link
Member

BTW #2217 also fixed a couple of the warnings.

@kholia kholia self-assigned this Aug 18, 2016
@kholia
Copy link
Member Author

kholia commented Aug 18, 2016

All the warnings reported in this issue are gone now. I am closing the ticket.

@kholia kholia closed this as completed Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants