functions.
+2008-06-02 Peter Maydell <pmaydell@chiark.greenend.org.uk>
+
+ * h/mh.h, h/prototypes.h, sbr/done.c, uip/inc.c,
+ uip/mhbuild.c, uip/mhlist.c, uip/mhn.c, uip/mhshow.c,
+ uip/mhstore.c, uip/mhtest.c, uip/packf.c, uip/pick.c,
+ uip/rcvdist.c, uip/rcvstore.c, uip/sendsbr.c: when
+ building on gcc, use the noreturn attribute on various
+ functions (should improve code and avoid some spurious
+ 'uninitialized variable' warnings).
+
2008-06-01 Peter Maydell <pmaydell@chiark.greenend.org.uk>
* docs/README.developers: update the bits about doing a
#endif
typedef unsigned char boolean; /* not int so we can pack in a structure */
+/* If we're using gcc then give it some information about
+ * functions that abort.
+ */
+#if __GNUC__ > 2
+#define NORETURN __attribute__((__noreturn__))
+#else
+#define NORETURN
+#endif
+
/*
* user context/profile structure
*/
extern char *whatnowproc;
extern char *whomproc;
-extern void (*done) (int);
+extern void (*done) (int) NORETURN;
#include <h/prototypes.h>
/*
* prototypes from the nmh subroutine library
*/
-void adios (char *, char *, ...);
+void adios (char *, char *, ...) NORETURN;
void admonish (char *, char *, ...);
void advertise (char *, char *, char *, va_list);
void advise (char *, char *, ...);
#include <h/mh.h>
-void (*done) (int) = exit;
+void (*done) (int) NORETURN = exit;
*/
char *map_name(char *);
-static void inc_done(int);
+static void inc_done(int) NORETURN;
#ifdef POP
static int pop_action(char *);
static int pop_pack(char *);
static char outfile[BUFSIZ];
static int unlink_outfile = 0;
-static void unlink_done (int);
+static void unlink_done (int) NORETURN;
/* mhbuildsbr.c */
CT build_mime (char *);
/* mhfree.c */
void free_content (CT);
extern CT *cts;
-void freects_done (int);
+void freects_done (int) NORETURN;
/*
* static prototypes
/* mhfree.c */
void free_content (CT);
extern CT *cts;
-void freects_done (int);
+void freects_done (int) NORETURN;
/*
* static prototypes
/* mhfree.c */
void free_content (CT);
extern CT *cts;
-void freects_done (int);
+void freects_done (int) NORETURN;
/*
* static prototypes
/* mhfree.c */
void free_content (CT);
extern CT *cts;
-void freects_done (int);
+void freects_done (int) NORETURN;
/*
* static prototypes
/* mhfree.c */
void free_content (CT);
extern CT *cts;
-void freects_done (int);
+void freects_done (int) NORETURN;
/*
* static prototypes
static int mbx_style = MBOX_FORMAT;
static int mapping = 0;
-static void mbxclose_done(int);
+static void mbxclose_done(int) NORETURN;
char *file = NULL;
static int listsw = -1;
-static void putzero_done (int);
+static void putzero_done (int) NORETURN;
int
main (int argc, char **argv)
* prototypes
*/
static void rcvdistout (FILE *, char *, char *);
-static void unlink_done (int);
+static void unlink_done (int) NORETURN;
int
*/
static char *tmpfilenam = NULL;
-static void unlink_done(int);
+static void unlink_done(int) NORETURN;
int
main (int argc, char **argv)
/*
* static prototypes
*/
-static void armed_done (int);
+static void armed_done (int) NORETURN;
static void alert (char *, int);
static int tmp_fd (void);
static void anno (int, struct stat *);