Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 97b1543

Browse files
committedAug 23, 2024·
Add HTS_NORETURN to test-bcf-sr usage and error functions
Hat-tip to John Marshall
1 parent 444dc05 commit 97b1543

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎test/test-bcf-sr.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@
3636
#include <strings.h>
3737
#include <errno.h>
3838

39+
#include "../htslib/hts_defs.h"
3940
#include "../htslib/synced_bcf_reader.h"
4041
#include "../htslib/hts.h"
4142
#include "../htslib/vcf.h"
4243

43-
void HTS_FORMAT(HTS_PRINTF_FMT, 1, 2) error(const char *format, ...)
44+
void HTS_FORMAT(HTS_PRINTF_FMT, 1, 2) HTS_NORETURN
45+
error(const char *format, ...)
4446
{
4547
va_list ap;
4648
va_start(ap, format);
@@ -49,7 +51,7 @@ void HTS_FORMAT(HTS_PRINTF_FMT, 1, 2) error(const char *format, ...)
4951
exit(EXIT_FAILURE);
5052
}
5153

52-
void usage(int exit_code)
54+
void HTS_NORETURN usage(int exit_code)
5355
{
5456
fprintf(stderr, "Usage: test-bcf-sr [OPTIONS] vcf-list.txt\n");
5557
fprintf(stderr, " test-bcf-sr [OPTIONS] -args file1.bcf [...]\n");
@@ -179,7 +181,6 @@ int main(int argc, char *argv[])
179181
break;
180182
case 'h':
181183
usage(EXIT_SUCCESS);
182-
// fall-through
183184
default: usage(EXIT_FAILURE);
184185
}
185186
}

0 commit comments

Comments
 (0)
Please sign in to comment.