Closed MurathanGoktas closed 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
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.