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

compilation warnings with GCC 7 and GCC 8 #32

Open
frederic-mahe opened this issue May 6, 2018 · 1 comment
Open

compilation warnings with GCC 7 and GCC 8 #32

frederic-mahe opened this issue May 6, 2018 · 1 comment

Comments

@frederic-mahe
Copy link

gcc (GCC) 7.1.0
Copyright (C) 2017 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.

asnparse.cc: In function 'void show_seq_id(apt, char*)':
asnparse.cc:610:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void show_seq_id(apt p, char * dbi)
      ^~~~~~~~~~~
asnparse.cc:616:12: note: 'sprintf' output 5 or more bytes (assuming 4101) into a destination of size 2048
     sprintf(p->id, "%s|%s.%lu|%s", db, p->accession, p->version, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:610:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void show_seq_id(apt p, char * dbi)
      ^~~~~~~~~~~
asnparse.cc:618:12: note: 'sprintf' output 3 or more bytes (assuming 4099) into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->accession, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc: In function 'void show_pat(apt)':
asnparse.cc:626:6: warning: '%s' directive writing up to 2047 bytes into a region of size 2044 [-Wformat-overflow=]
 void show_pat(apt p)
      ^~~~~~~~
asnparse.cc:628:10: note: 'sprintf' output between 8 and 4121 bytes into a destination of size 2048
   sprintf(p->id, "%s|%s|%s|%lu", p->pat_granted ? "pat" : "pgp",
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    p->pat_country, p->pat_id, p->pat_sequence);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc: In function 'void parse_seq_id(apt)':
asnparse.cc:632:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:616:12: note: 'sprintf' output 5 or more bytes (assuming 4101) into a destination of size 2048
     sprintf(p->id, "%s|%s.%lu|%s", db, p->accession, p->version, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:618:12: note: 'sprintf' output 3 or more bytes (assuming 4099) into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->accession, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:690:14: note: 'sprintf' output 2 or more bytes (assuming 2049) into a destination of size 2048
       sprintf(p->id, "%s|%s", db, p->gnl_id_string);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '%s' directive writing up to 2047 bytes into a region of size 2044 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:628:10: note: 'sprintf' output between 8 and 4121 bytes into a destination of size 2048
   sprintf(p->id, "%s|%s|%s|%lu", p->pat_granted ? "pat" : "pgp",
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    p->pat_country, p->pat_id, p->pat_sequence);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '|' directive writing 1 byte into a region of size between 0 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:708:14: note: 'sprintf' output 3 or more bytes (assuming 4097) into a destination of size 2048
       sprintf(p->id, "%s|%s|%s", db, p->gnl_db, p->gnl_id_string);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '|' directive writing 1 byte into a region of size between 0 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:710:14: note: 'sprintf' output 4 or more bytes (assuming 2051) into a destination of size 2048
       sprintf(p->id, "%s|%s|%lu", db, p->gnl_db, p->gnl_id_integer);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '|' directive writing 1 byte into a region of size between 0 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:725:12: note: 'sprintf' output 3 or more bytes (assuming 2050) into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->pdb_molid, chain);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc (GCC) 7.2.0
Copyright (C) 2017 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.

asnparse.cc: In function 'void show_seq_id(apt, char*)':
asnparse.cc:610:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void show_seq_id(apt p, char * dbi)
      ^~~~~~~~~~~
asnparse.cc:616:12: note: 'sprintf' output 5 or more bytes (assuming 4101) into a destination of size 2048
     sprintf(p->id, "%s|%s.%lu|%s", db, p->accession, p->version, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:610:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void show_seq_id(apt p, char * dbi)
      ^~~~~~~~~~~
asnparse.cc:618:12: note: 'sprintf' output 3 or more bytes (assuming 4099) into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->accession, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc: In function 'void show_pat(apt)':
asnparse.cc:626:6: warning: '%s' directive writing up to 2047 bytes into a region of size 2044 [-Wformat-overflow=]
 void show_pat(apt p)
      ^~~~~~~~
asnparse.cc:628:10: note: 'sprintf' output between 8 and 4121 bytes into a destination of size 2048
   sprintf(p->id, "%s|%s|%s|%lu", p->pat_granted ? "pat" : "pgp",
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    p->pat_country, p->pat_id, p->pat_sequence);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc: In function 'void parse_seq_id(apt)':
asnparse.cc:632:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:616:12: note: 'sprintf' output 5 or more bytes (assuming 4101) into a destination of size 2048
     sprintf(p->id, "%s|%s.%lu|%s", db, p->accession, p->version, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:618:12: note: 'sprintf' output 3 or more bytes (assuming 4099) into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->accession, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:690:14: note: 'sprintf' output 2 or more bytes (assuming 2049) into a destination of size 2048
       sprintf(p->id, "%s|%s", db, p->gnl_id_string);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '%s' directive writing up to 2047 bytes into a region of size 2044 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:628:10: note: 'sprintf' output between 8 and 4121 bytes into a destination of size 2048
   sprintf(p->id, "%s|%s|%s|%lu", p->pat_granted ? "pat" : "pgp",
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    p->pat_country, p->pat_id, p->pat_sequence);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '|' directive writing 1 byte into a region of size between 0 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:708:14: note: 'sprintf' output 3 or more bytes (assuming 4097) into a destination of size 2048
       sprintf(p->id, "%s|%s|%s", db, p->gnl_db, p->gnl_id_string);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '|' directive writing 1 byte into a region of size between 0 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:710:14: note: 'sprintf' output 4 or more bytes (assuming 2051) into a destination of size 2048
       sprintf(p->id, "%s|%s|%lu", db, p->gnl_db, p->gnl_id_integer);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '|' directive writing 1 byte into a region of size between 0 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:725:12: note: 'sprintf' output 3 or more bytes (assuming 2050) into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->pdb_molid, chain);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc (GCC) 7.3.0
Copyright (C) 2017 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.

asnparse.cc: In function 'void show_seq_id(apt, char*)':
asnparse.cc:610:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void show_seq_id(apt p, char * dbi)
      ^~~~~~~~~~~
asnparse.cc:616:12: note: 'sprintf' output 5 or more bytes (assuming 4101) into a destination of size 2048
     sprintf(p->id, "%s|%s.%lu|%s", db, p->accession, p->version, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:610:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void show_seq_id(apt p, char * dbi)
      ^~~~~~~~~~~
asnparse.cc:618:12: note: 'sprintf' output 3 or more bytes (assuming 4099) into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->accession, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc: In function 'void show_pat(apt)':
asnparse.cc:626:6: warning: '%s' directive writing up to 2047 bytes into a region of size 2044 [-Wformat-overflow=]
 void show_pat(apt p)
      ^~~~~~~~
asnparse.cc:628:10: note: 'sprintf' output between 8 and 4121 bytes into a destination of size 2048
   sprintf(p->id, "%s|%s|%s|%lu", p->pat_granted ? "pat" : "pgp",
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    p->pat_country, p->pat_id, p->pat_sequence);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc: In function 'void parse_seq_id(apt)':
asnparse.cc:632:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:616:12: note: 'sprintf' output 5 or more bytes (assuming 4101) into a destination of size 2048
     sprintf(p->id, "%s|%s.%lu|%s", db, p->accession, p->version, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:618:12: note: 'sprintf' output 3 or more bytes (assuming 4099) into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->accession, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:690:14: note: 'sprintf' output 2 or more bytes (assuming 2049) into a destination of size 2048
       sprintf(p->id, "%s|%s", db, p->gnl_id_string);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '%s' directive writing up to 2047 bytes into a region of size 2044 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:628:10: note: 'sprintf' output between 8 and 4121 bytes into a destination of size 2048
   sprintf(p->id, "%s|%s|%s|%lu", p->pat_granted ? "pat" : "pgp",
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    p->pat_country, p->pat_id, p->pat_sequence);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '|' directive writing 1 byte into a region of size between 0 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:708:14: note: 'sprintf' output 3 or more bytes (assuming 4097) into a destination of size 2048
       sprintf(p->id, "%s|%s|%s", db, p->gnl_db, p->gnl_id_string);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '|' directive writing 1 byte into a region of size between 0 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:710:14: note: 'sprintf' output 4 or more bytes (assuming 2051) into a destination of size 2048
       sprintf(p->id, "%s|%s|%lu", db, p->gnl_db, p->gnl_id_integer);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:632:6: warning: '|' directive writing 1 byte into a region of size between 0 and 2047 [-Wformat-overflow=]
 void parse_seq_id(apt p)
      ^~~~~~~~~~~~
asnparse.cc:725:12: note: 'sprintf' output 3 or more bytes (assuming 2050) into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->pdb_molid, chain);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc (GCC) 8.1.0
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.

matrices.cc: In function 'void score_matrix_read_string(const char*)':
matrices.cc:459:14: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
       strncpy(line, s, linelen);
       ~~~~~~~^~~~~~~~~~~~~~~~~~
matrices.cc:457:18: note: length computed here
  linelen = strlen(s);
            ~~~~~~^~~
asnparse.cc: In function 'void show_seq_id(apt, char*)':
asnparse.cc:618:20: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
     sprintf(p->id, "%s|%s|%s", db, p->accession, p->name);
                    ^~~~~~~~~~
asnparse.cc:618:12: note: 'sprintf' output 3 or more bytes (assuming 4099) into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->accession, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:616:20: warning: '%s' directive writing up to 2047 bytes into a region of size between 2045 and 2047 [-Wformat-overflow=]
     sprintf(p->id, "%s|%s.%lu|%s", db, p->accession, p->version, p->name);
                    ^~~~~~~~~~~~~~
asnparse.cc:616:12: note: 'sprintf' output 5 or more bytes (assuming 4101) into a destination of size 2048
     sprintf(p->id, "%s|%s.%lu|%s", db, p->accession, p->version, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc: In function 'void show_pat(apt)':
asnparse.cc:628:18: warning: '%s' directive writing up to 2047 bytes into a region of size 2044 [-Wformat-overflow=]
   sprintf(p->id, "%s|%s|%s|%lu", p->pat_granted ? "pat" : "pgp",
                  ^~~~~~~~~~~~~~
asnparse.cc:628:10: note: 'sprintf' output between 8 and 4121 bytes into a destination of size 2048
   sprintf(p->id, "%s|%s|%s|%lu", p->pat_granted ? "pat" : "pgp",
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    p->pat_country, p->pat_id, p->pat_sequence);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc: In function 'void parse_seq_id(apt)':
asnparse.cc:725:20: warning: '%s' directive writing up to 2047 bytes into a region of size between 2044 and 2047 [-Wformat-overflow=]
     sprintf(p->id, "%s|%s|%s", db, p->pdb_molid, chain);
                    ^~~~~~~~~~
asnparse.cc:725:12: note: 'sprintf' output between 3 and 2055 bytes into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->pdb_molid, chain);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:710:22: warning: '%s' directive writing up to 2047 bytes into a region of size between 2044 and 2047 [-Wformat-overflow=]
       sprintf(p->id, "%s|%s|%lu", db, p->gnl_db, p->gnl_id_integer);
                      ^~~~~~~~~~~
asnparse.cc:710:14: note: 'sprintf' output between 4 and 2073 bytes into a destination of size 2048
       sprintf(p->id, "%s|%s|%lu", db, p->gnl_db, p->gnl_id_integer);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:708:22: warning: '%s' directive writing up to 2047 bytes into a region of size between 2044 and 2047 [-Wformat-overflow=]
       sprintf(p->id, "%s|%s|%s", db, p->gnl_db, p->gnl_id_string);
                      ^~~~~~~~~~
asnparse.cc:708:14: note: 'sprintf' output between 3 and 4100 bytes into a destination of size 2048
       sprintf(p->id, "%s|%s|%s", db, p->gnl_db, p->gnl_id_string);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:628:18: warning: '%s' directive writing up to 2047 bytes into a region of size 2044 [-Wformat-overflow=]
   sprintf(p->id, "%s|%s|%s|%lu", p->pat_granted ? "pat" : "pgp",
                  ^~~~~~~~~~~~~~
asnparse.cc:628:10: note: 'sprintf' output between 8 and 4121 bytes into a destination of size 2048
   sprintf(p->id, "%s|%s|%s|%lu", p->pat_granted ? "pat" : "pgp",
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    p->pat_country, p->pat_id, p->pat_sequence);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:618:20: warning: '%s' directive writing up to 2047 bytes into a region of size between 2044 and 2047 [-Wformat-overflow=]
     sprintf(p->id, "%s|%s|%s", db, p->accession, p->name);
                    ^~~~~~~~~~
asnparse.cc:618:12: note: 'sprintf' output between 3 and 4100 bytes into a destination of size 2048
     sprintf(p->id, "%s|%s|%s", db, p->accession, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:616:20: warning: '%s' directive writing up to 2047 bytes into a region of size between 2044 and 2047 [-Wformat-overflow=]
     sprintf(p->id, "%s|%s.%lu|%s", db, p->accession, p->version, p->name);
                    ^~~~~~~~~~~~~~
asnparse.cc:616:12: note: 'sprintf' output between 5 and 4121 bytes into a destination of size 2048
     sprintf(p->id, "%s|%s.%lu|%s", db, p->accession, p->version, p->name);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc:690:22: warning: '%s' directive writing up to 2047 bytes into a region of size between 2044 and 2047 [-Wformat-overflow=]
       sprintf(p->id, "%s|%s", db, p->gnl_id_string);
                      ^~~~~~~
asnparse.cc:690:14: note: 'sprintf' output between 2 and 2052 bytes into a destination of size 2048
       sprintf(p->id, "%s|%s", db, p->gnl_id_string);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asnparse.cc: In function 'void parse_blast_def_line(apt)':
asnparse.cc:866:9: warning: 'char* strcat(char*, const char*)' accessing 10241 or more bytes at offsets 36976 and 26736 may overlap 1 byte at offset 36976 [-Wrestrict]
   strcat(p->defline, p->title);
   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
@frederic-mahe
Copy link
Author

There is no warning with GCC 6 or older.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant