samtools / htslib

C library for high-throughput sequencing data formats
Other
803 stars 446 forks source link

Replace assert(0) with abort() #1792

Closed mp15 closed 3 months ago

mp15 commented 3 months ago

Replaces assert(0) with abort(). This ensures no behaviour change except the check is now not skipped when NDEBUG is defined. Fixes #1791

jkbonfield commented 3 months ago

I see it calls exit(1) earlier. It ought to return rather than exit, but I haven't looked into what uses it and whether any code checks for errors.

pd3 commented 3 months ago

This would benefit from a review. It might be better to propagate some of these errors to the caller rather than exit. However, this is certainly better than what was there before. Thank you