prophyle/prophex

Check the following warnings

Opened this issue · 0 comments

Especially signed vs unsigned

prophex_query.c: In function ‘calculate_sa_interval’:
prophex_query.c:33:20: warning: too many arguments for format [-Wformat-extra-args]
    fprintf(stderr, "[prophex:%s .1] i=%d c=" PRIu64 " k=" PRIu64 " l=" PRIu64, __func__, i, (uint64_t) c, k, l);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
prophex_query.c:40:20: warning: too many arguments for format [-Wformat-extra-args]
    fprintf(stderr, "[prophex:%s .2] i=%d c=" PRIu64 " k=" PRIu64 " l=" PRIu64, __func__, i, (uint64_t) c, k, l);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
prophex_query.c:43:20: warning: too many arguments for format [-Wformat-extra-args]
    fprintf(stderr, "[prophex:%s .3] i=%d c=" PRIu64 " k=" PRIu64 " l=" PRIu64, __func__, i, (uint64_t) c, k, l);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
prophex_query.c: In function ‘get_positions’:
prophex_query.c:69:96: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
    fprintf(stderr, "[prophex:%s] translation from SA-pos to seq-pos is truncated, too many (%llu) positions\n", __func__, l - k + 1);
                                                                                                ^
prophex_query.c: In function ‘print_read’:
prophex_query.c:225:32: warning: array subscript has type ‘char’ [-Wchar-subscripts]
   fprintf(stdout, "%c", "ACGTN"[p->seq[j]]);
                                ^
prophex_query.c: In function ‘process_sequence’:
prophex_query.c:333:25: warning: pointer targets in passing argument 2 of ‘seq_reverse’ differ in signedness [-Wpointer-sign]
  seq_reverse(seq.l_seq, seq.seq, 0);
In file included from prophex_query.h:13:0,
                 from prophex_query.c:1:
bwa/bwtaln.h:140:7: note: expected ‘ubyte_t * {aka unsigned char *}’ but argument is of type ‘char *’
  void seq_reverse(int len, ubyte_t *seq, int is_comp);
       ^~~~~~~~~~~
prophex_query.c:403:58: warning: pointer targets in passing argument 3 of ‘calculate_sa_interval_restart’ differ in signedness [-Wpointer-sign]
     calculate_sa_interval_restart(bwt, opt->kmer_length, seq.seq, &k, &l, start_pos);
                                                          ^~~
prophex_query.c:50:5: note: expected ‘const ubyte_t * {aka const unsigned char *}’ but argument is of type ‘char *’
 int calculate_sa_interval_restart(const bwt_t* bwt, int len, const ubyte_t* str, uint64_t* k, uint64_t* l, int start_pos) {
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prophex_query.c:406:45: warning: pointer targets in passing argument 3 of ‘calculate_sa_interval_continue’ differ in signedness [-Wpointer-sign]
      calculate_sa_interval_continue(bwt, 1, seq.seq, &k, &l, &decreased_k, &increased_l, start_pos + opt->kmer_length - 1, klcp);
                                             ^~~
prophex_query.c:56:5: note: expected ‘const ubyte_t * {aka const unsigned char *}’ but argument is of type ‘char *’
 int calculate_sa_interval_continue(const bwt_t* bwt, int len, const ubyte_t* str, uint64_t* k, uint64_t* l, uint64_t* decreased_k,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prophex_query.c:410:59: warning: pointer targets in passing argument 3 of ‘calculate_sa_interval_restart’ differ in signedness [-Wpointer-sign]
      calculate_sa_interval_restart(bwt, opt->kmer_length, seq.seq, &k, &l, start_pos);
                                                           ^~~
prophex_query.c:50:5: note: expected ‘const ubyte_t * {aka const unsigned char *}’ but argument is of type ‘char *’
 int calculate_sa_interval_restart(const bwt_t* bwt, int len, const ubyte_t* str, uint64_t* k, uint64_t* l, int start_pos) {
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prophex_query.c: In function ‘query’:
prophex_query.c:577:46: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘int64_t {aka long int}’ [-Wformat=]
  fprintf(stderr, "[prophex::%s] Processed %llu reads in %.3f CPU sec, %.3f real sec\n", __func__, total_seqs, cputime() - ctime,
                                              ^
gcc -c -pg -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS -Ibwa prophex_build.c -o prophex_build.o
prophex_build.c: In function ‘bwt2fa’:
prophex_build.c:135:37: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘bwtint_t {aka long unsigned int}’ [-Wformat=]
    fprintf(stderr, "[prophex:%s] %llu percents completed..\n", __func__, 10 * i / progress_output_step);
                                     ^
gcc -c -pg -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS -Ibwa klcp.c -o klcp.o
gcc -c -pg -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS -Ibwa bitarray.c -o bitarray.o
gcc -c -pg -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS -Ibwa bwa_utils.c -o bwa_utils.o
bwa_utils.c: In function ‘bns_restore_ann_only’:
bwa_utils.c:191:8: warning: unused variable ‘fp’ [-Wunused-variable]
  FILE* fp;
        ^~