torognes / swarm

A robust and fast clustering method for amplicon-based studies
GNU Affero General Public License v3.0
123 stars 23 forks source link

Compilation warnings with the new GCC 8.0 #112

Closed frederic-mahe closed 6 years ago

frederic-mahe commented 6 years ago
gcc (GCC) 8.0.1 20180128 (experimental)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

nw.cc: In function 'void pushop(char, char**, char*, int*)':
nw.cc:38:14: warning: 'char* strncpy(char*, const char*, size_t)' output may be truncated copying between 1 and 11 bytes from a string of length 24 [-Wstringop-truncation]
       strncpy(*cigarendp, buf, len);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
nw.cc: In function 'void finishop(char**, char*, int*)':
nw.cc:55:14: warning: 'char* strncpy(char*, const char*, size_t)' output may be truncated copying between 1 and 11 bytes from a string of length 24 [-Wstringop-truncation]
       strncpy(*cigarendp, buf, len);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
nw.cc: In function 'void nw(char*, char*, char*, char*, long int*, long unsigned int, long unsigned int, long unsigned int*, long unsigned int*, long unsigned int*, char**, unsigned char*, long unsigned int*, long unsigned int, long unsigned int)':
nw.cc:38:14: warning: 'char* strncpy(char*, const char*, size_t)' output may be truncated copying between 1 and 10 bytes from a string of length 24 [-Wstringop-truncation]
       strncpy(*cigarendp, buf, len);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
nw.cc:38:14: warning: 'char* strncpy(char*, const char*, size_t)' output may be truncated copying between 1 and 10 bytes from a string of length 24 [-Wstringop-truncation]
       strncpy(*cigarendp, buf, len);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
nw.cc:38:14: warning: 'char* strncpy(char*, const char*, size_t)' output may be truncated copying between 1 and 10 bytes from a string of length 24 [-Wstringop-truncation]
       strncpy(*cigarendp, buf, len);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
nw.cc:38:14: warning: 'char* strncpy(char*, const char*, size_t)' output may be truncated copying between 1 and 10 bytes from a string of length 24 [-Wstringop-truncation]
       strncpy(*cigarendp, buf, len);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
nw.cc:38:14: warning: 'char* strncpy(char*, const char*, size_t)' output may be truncated copying between 1 and 10 bytes from a string of length 24 [-Wstringop-truncation]
       strncpy(*cigarendp, buf, len);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
nw.cc:55:14: warning: 'char* strncpy(char*, const char*, size_t)' output may be truncated copying between 1 and 10 bytes from a string of length 24 [-Wstringop-truncation]
       strncpy(*cigarendp, buf, len);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

See GCC 8.0 changes for some details.

torognes commented 6 years ago

Probably fixed in a recent commit (08564891dc0b6fd64da09ee269d01748ad3fc847) but it is difficult for me to test it as none of our machines have gcc 8.

frederic-mahe commented 6 years ago

No more warnings and all tests pass :smile: swarm will soon be officially compatible with gcc 8.