Closed frederic-mahe closed 7 years ago
You might also want to try -Wpedantic
, to get "clean" ISO code. See here for details: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Hi @lczech, adding -Wpedantic
reports two additional warnings:
search8.cc: In function ‘void search8(BYTE**, BYTE, BYTE, BYTE*, BYTE*, BYTE*, long unsigned int, long unsigned int*, long unsigned int*, long unsigned int*, long unsigned int*, long unsigned int, long unsigned int, long unsigned int*)’:
search8.cc:858:67: warning: overflow in implicit constant conversion [-Woverflow]
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff);
^
search16.cc: In function ‘void search16(WORD**, WORD, WORD, WORD*, WORD*, WORD*, long unsigned int, long unsigned int*, long unsigned int*, long unsigned int*, long unsigned int*, long unsigned int, long unsigned int, long unsigned int*)’:
search16.cc:573:49: warning: overflow in implicit constant conversion [-Woverflow]
T0 = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, 0xffff);
^
Hum, these warnings could be false-positives. And I am not sure which ISO C++ version swarm's code follows.
I have made changes to the source code to remove the warnings you have indicated. They do not represent errors or bugs. I have also added the -Wextra
and -Woverflow
to the compiler flags in the Makefile. Adding -Wpedantic
or even -Weverything
gives me many more warnings. I have looked through them, but they are all warnings that do not, as far as I can see, represent errors or bugs in the code. But it would take a lot of time to remove those warnings.
I have added the -Wpedantic
warning option as well, but using the -Wno-c++11-long-long
option I disabled some warnings I got in the CityHash code.
I think we should add
-Wextra
to swarm's Makefile. Here is the output of GCC 6.3: