Running the clang static analyser turns up an issue with unintialised… #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… pointer in alignment-file.c
The clang analyser reports the following, which have now been addressed. I'm hoping to run some other analysers over the next few days.
$ scan-build gcc -c src/*.c -I .
scan-build: Using '/usr/bin/clang' for static analysis
src/alignment-file.c:126:15: warning: Potential leak of memory pointed to by 'first_sequence'
for(i = 0; i < length_of_genome; i++)
^src/alignment-file.c:134:10: warning: Dereference of undefined pointer value
if(first_sequence[i] == 'N' && !is_unknown(seq->seq.s[i]))
^~~~~~~~~~~~~~~~~
src/alignment-file.c:160:10: warning: Dereference of undefined pointer value
if(first_sequence[i] == '>')
^~~~~~~~~~~~~~~~~
src/alignment-file.c:166:3: warning: Function call argument is an uninitialized value
free(first_sequence);
^~~~~~~~~~~~~~~~~~~~
4 warnings generated.
scan-build: 4 bugs found.