arq5x / lumpy-sv

lumpy: a general probabilistic framework for structural variant discovery
MIT License
309 stars 118 forks source link

lumpy_filter :: undefined exit value #292

Open EricDeveaud opened 5 years ago

EricDeveaud commented 5 years ago

Hello,

lumpy_filter ends with an undefined exit value in case of success.

when -Wall are in the CFLAGS flags, one can see

filter.c:378:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^

from filter.c

int main(int argc, char **argv)
 //snip//snap
    fprintf(stderr, "[lumpy_filter] extracted splits and discordants from %d total aligned reads\n", aligned_reads);
    if(ret < -1) {
        errx(1, "lumpy_filter: error reading bam: %s\n", bam_file_name);
    }
}

when main finnish correctly, ie ret == 0 as no main has no return value the returned (aka exit value) is undefined so exit value is incorrect

should be:

int main(int argc, char **argv)
 //snip//snap
    fprintf(stderr, "[lumpy_filter] extracted splits and discordants from %d total aligned reads\n", aligned_reads);
    if(ret < -1) {
        errx(1, "lumpy_filter: error reading bam: %s\n", bam_file_name);
    }
    return ret;
}