Biopython: Compiler warning in Bio/cpairwise2module.c

Created on 20 Jan 2017  Â·  4Comments  Â·  Source: biopython/biopython

e.g. https://travis-ci.org/biopython/biopython/jobs/193783495 says

Bio/cpairwise2module.c: In function ‘cpairwise2__make_score_matrix_fast’:
Bio/cpairwise2module.c:376:17: warning: ‘py_trace_row’ may be used uninitialized in this function [-Wuninitialized]

From an initial reading of the code, this is harmless - my guess is the score_only branching makes this hard to tell automatically?

help wanted

All 4 comments

@peterjc Yes, this is harmless, 'py_trace_row' is only initialized if it is needed. If 'score_only' is true, it is not needed and not initialized. This should save some memory.
If 'score_only' is false, 'py_trace_row' is initialized and only in this case it is also used.

So shall we leave this issue open to skip initialising py_trace_row if score_only is true?

I have an open PR regarding pairwise2, where I also did some changes on the C module. I can add a line that makes sure that py_trace_row will always be initialized, to make the compiler happy.

No more compiler warnings from cpairwise2.

Was this page helpful?
0 / 5 - 0 ratings