bcgsc / tigmint

⛓ Correct misassemblies using linked AND long reads
https://bcgsc.github.io/tigmint/
GNU General Public License v3.0
54 stars 13 forks source link

clang-tidy fix #49

Closed MurathanGoktas closed 3 years ago

MurathanGoktas commented 3 years ago

The reason for the error is that the static struct longopt is pointing to variables such as help, version that are stored in stack and will be diminished when main function returns. As static variable longopts will survive throughout the program and will not be freed after function call, this caused a dangling reference.

Setting the variables _help, version, with_fasta , with_bx_multiplicity , with_bx_multiplicityonly to be static fixed the error.

jwcodee commented 3 years ago

Thanks @MurathanGoktas . What I don't understand is why is the code that I added triggering clang-tidy. What I mean is that dangling reference error has always existed. The code I added shouldn't have affected it. Regardless thank you so much