From b94dfe3cd4997c6a48e28616d4d3fe5922978a58 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 5 Jul 2017 21:27:30 +0100 Subject: [PATCH] progs/catsign.c: Mark the various `choke' functions as `NORETURN'. If I don't do this, then Clang complains (otherwise correctly) that `y' might be used uninitialized. --- progs/catsign.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/progs/catsign.c b/progs/catsign.c index 7db8aa20..671cea6e 100644 --- a/progs/catsign.c +++ b/progs/catsign.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -435,11 +436,12 @@ static void sig_writeheader(enc *e, sigmsg *s) static void sig_writesig(enc *e, sigmsg *s) { chunk_write(e, s->sig.buf, s->sig.len); } -static void diechoke(const char *m, void *p) +static void NORETURN diechoke(const char *m, void *p) { die(EXIT_FAILURE, "%s%s%s", (const char *)p, p ? ": " : "", m); } static void sig_readheader(enc *e, sigmsg *s, - void (*choke)(const char *, void *), void *p) + void NORETURN (*choke)(const char *, void *), + void *p) { uint16 f; octet bb[MSGBUFSZ]; @@ -612,7 +614,7 @@ static int vrfbdry(const char *b, void *p) return (0); } -static void vrfchoke(const char *m, void *p) +static void NORETURN vrfchoke(const char *m, void *p) { vrfctx *v = p; if (v->verb) printf("FAIL %s: %s\n", v->what, m); @@ -983,7 +985,7 @@ static int format(int argc, char *argv[]) return (0); } -static void infochoke(const char *m, void *p) +static void NORETURN infochoke(const char *m, void *p) { vrfctx *v = p; printf("BAD %s: %s\n", v->what, m); -- 2.11.0