hsinnan75 / MapCaller

MapCaller – An efficient and versatile approach for short-read alignment and variant detection in high-throughput sequenced genomes
MIT License
30 stars 5 forks source link

Add -Wall to src/makefile and check all warnings #12

Closed tseemann closed 4 years ago

tseemann commented 4 years ago

It is important to use -Wall when compiling your software. Some of them could be important:

VariantCalling.cpp:473:128: warning: format specifies type 'int' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
VariantCalling.cpp:479:120: warning: format specifies type 'int' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
VariantCalling.cpp:485:120: warning: format specifies type 'int' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
VariantCalling.cpp:490:122: warning: format specifies type 'int' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
VariantCalling.cpp:495:118: warning: format specifies type 'int' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
VariantCalling.cpp:453:27: warning: unused variable 'cov' [-Wunused-variable]
VariantCalling.cpp:453:9: warning: unused variable 'n' [-Wunused-variable]
VariantCalling.cpp:453:22: warning: unused variable 'thr' [-Wunused-variable]
VariantCalling.cpp:453:12: warning: unused variable 'len' [-Wunused-variable]
VariantCalling.cpp:453:32: warning: unused variable 'dupN' [-Wunused-variable]
VariantCalling.cpp:536:20: warning: array subscript is of type 'char' [-Wchar-subscripts]
VariantCalling.cpp:575:42: warning: array subscript is of type 'char' [-Wchar-subscripts]
VariantCalling.cpp:527:83: warning: unused variable 'del_len' [-Wunused-variable]
VariantCalling.cpp:527:6: warning: unused variable 'i' [-Wunused-variable]
VariantCalling.cpp:519:7: warning: unused variable 'bShow' [-Wunused-variable]
VariantCalling.cpp:527:64: warning: unused variable 'ins_len' [-Wunused-variable]
ReadMapping.cpp:27:27: warning: format specifies type 'int' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ReadMapping.cpp:27:74: warning: format specifies type 'int' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ReadMapping.cpp:115:73: warning: format specifies type 'long long' but the argument has type 'int' [-Wformat]
ReadMapping.cpp:122:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
ReadMapping.cpp:130:24: warning: unused variable 'Ncount' [-Wunused-variable]
ReadMapping.cpp:165:18: warning: unused variable 'NewBegIdx' [-Wunused-variable]
ReadMapping.cpp:165:29: warning: unused variable 'NewEndIdx' [-Wunused-variable]
ReadMapping.cpp:165:40: warning: unused variable 'num' [-Wunused-variable]
ReadMapping.cpp:165:12: warning: unused variable 'q' [-Wunused-variable]
ReadMapping.cpp:258:27: warning: unused variable 'dist' [-Wunused-variable]
ReadMapping.cpp:258:33: warning: unused variable 'PairedIdx' [-Wunused-variable]
ReadMapping.cpp:258:44: warning: unused variable 'score' [-Wunused-variable]
ReadMapping.cpp:258:18: warning: unused variable 'myError' [-Wunused-variable]
ReadMapping.cpp:371:10: warning: unused variable 'dist' [-Wunused-variable]
ReadMapping.cpp:372:9: warning: unused variable 'j' [-Wunused-variable]
ReadMapping.cpp:372:6: warning: unused variable 'i' [-Wunused-variable]
ReadMapping.cpp:581:45: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
ReadMapping.cpp:630:45: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
ReadMapping.cpp:706:7: warning: unused variable 'buf' [-Wunused-variable]
ReadMapping.cpp:707:9: warning: unused variable 'iDiscordant' [-Wunused-variable]
ReadMapping.cpp:707:22: warning: unused variable 'minDist' [-Wunused-variable]
ReadMapping.cpp:707:31: warning: unused variable 'maxDist' [-Wunused-variable]
AlignmentRescue.cpp:35:8: warning: unused variable 'UsedArr' [-Wunused-variable]
AlignmentRescue.cpp:75:9: warning: unused variable 'j' [-Wunused-variable]
AlignmentRescue.cpp:75:6: warning: unused variable 'i' [-Wunused-variable]
AlignmentRescue.cpp:3:24: warning: unused variable 'Lock' [-Wunused-variable]
ReadAlignment.cpp:123:6: warning: unused variable 'i' [-Wunused-variable]
ReadAlignment.cpp:160:7: warning: unused variable 'i' [-Wunused-variable]
ReadAlignment.cpp:160:13: warning: unused variable 'clip_size' [-Wunused-variable]
ReadAlignment.cpp:160:24: warning: unused variable 'max_mismatch' [-Wunused-variable]
ReadAlignment.cpp:241:6: warning: unused variable 'i' [-Wunused-variable]
ReadAlignment.cpp:315:15: warning: unused variable 'Rshrink' [-Wunused-variable]
ReadAlignment.cpp:315:24: warning: unused variable 'Gshrink' [-Wunused-variable]
ReadAlignment.cpp:315:12: warning: unused variable 'n' [-Wunused-variable]
ReadAlignment.cpp:315:9: warning: unused variable 'j' [-Wunused-variable]
AlignmentProfile.cpp:45:7: warning: unused variable 'bChecked' [-Wunused-variable]
AlignmentProfile.cpp:45:17: warning: unused variable 'bShow' [-Wunused-variable]
SamReport.cpp:23:22: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
tools.cpp:112:66: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
bwt_index.cpp:243:9: warning: unused variable 'ret' [-Wunused-variable]
bwt_search.cpp:264:34: warning: format specifies type 'int' but the argument has type 'bwtint_t' (aka 'unsigned long long') [-Wformat]
bwt_search.cpp:275:47: warning: format specifies type 'int' but the argument has type 'bwtint_t' (aka 'unsigned long long') [-Wformat]
nw_alignment.cpp:55:50: warning: array subscript is of type 'char' [-Wchar-subscripts]
nw_alignment.cpp:55:78: warning: array subscript is of type 'char' [-Wchar-subscripts]
hsinnan75 commented 4 years ago

I've fixed all those problems and updated the makefile. Thank you!

tseemann commented 4 years ago

Great work.