progs/catsign.c: Mark the various `choke' functions as `NORETURN'.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 5 Jul 2017 20:27:30 +0000 (21:27 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 5 Jul 2017 20:27:30 +0000 (21:27 +0100)
If I don't do this, then Clang complains (otherwise correctly) that `y'
might be used uninitialized.

progs/catsign.c

index 7db8aa2..671cea6 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <mLib/base64.h>
 #include <mLib/dstr.h>
+#include <mLib/macros.h>
 #include <mLib/mdwopt.h>
 #include <mLib/quis.h>
 #include <mLib/report.h>
@@ -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);