nmh-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-commits] nmh ChangeLog h/mh.h h/prototypes.h sbr/done.c ...


From: Peter Maydell
Subject: [Nmh-commits] nmh ChangeLog h/mh.h h/prototypes.h sbr/done.c ...
Date: Mon, 02 Jun 2008 22:37:02 +0000

CVSROOT:        /sources/nmh
Module name:    nmh
Changes by:     Peter Maydell <pm215>   08/06/02 22:37:02

Modified files:
        .              : ChangeLog 
        h              : mh.h prototypes.h 
        sbr            : done.c 
        uip            : inc.c mhbuild.c mhlist.c mhn.c mhshow.c 
                         mhstore.c mhtest.c packf.c pick.c rcvdist.c 
                         rcvstore.c sendsbr.c 

Log message:
        When building on gcc, use noreturn attribute on adios and the various 
done
        functions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/nmh/ChangeLog?cvsroot=nmh&r1=1.274&r2=1.275
http://cvs.savannah.gnu.org/viewcvs/nmh/h/mh.h?cvsroot=nmh&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/nmh/h/prototypes.h?cvsroot=nmh&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/nmh/sbr/done.c?cvsroot=nmh&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/inc.c?cvsroot=nmh&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/mhbuild.c?cvsroot=nmh&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/mhlist.c?cvsroot=nmh&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/mhn.c?cvsroot=nmh&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/mhshow.c?cvsroot=nmh&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/mhstore.c?cvsroot=nmh&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/mhtest.c?cvsroot=nmh&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/packf.c?cvsroot=nmh&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/pick.c?cvsroot=nmh&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/rcvdist.c?cvsroot=nmh&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/rcvstore.c?cvsroot=nmh&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/sendsbr.c?cvsroot=nmh&r1=1.17&r2=1.18

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/nmh/nmh/ChangeLog,v
retrieving revision 1.274
retrieving revision 1.275
diff -u -b -r1.274 -r1.275
--- ChangeLog   2 Jun 2008 22:05:11 -0000       1.274
+++ ChangeLog   2 Jun 2008 22:37:01 -0000       1.275
@@ -1,3 +1,13 @@
+2008-06-02  Peter Maydell  <address@hidden>
+
+       * 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  <address@hidden>
 
        * docs/README.developers: update the bits about doing a

Index: h/mh.h
===================================================================
RCS file: /sources/nmh/nmh/h/mh.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- h/mh.h      4 Nov 2007 11:54:32 -0000       1.8
+++ h/mh.h      2 Jun 2008 22:37:01 -0000       1.9
@@ -2,7 +2,7 @@
 /*
  * mh.h -- main header file for all of nmh
  *
- * $Id: mh.h,v 1.8 2007/11/04 11:54:32 jjr Exp $
+ * $Id: mh.h,v 1.9 2008/06/02 22:37:01 pm215 Exp $
  */
 
 #include <h/nmh.h>
@@ -29,6 +29,15 @@
 #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
  */
@@ -336,7 +345,7 @@
 extern char *whatnowproc;
 extern char *whomproc;
 
-extern void (*done) (int);
+extern void (*done) (int) NORETURN;
 
 #include <h/prototypes.h>
 

Index: h/prototypes.h
===================================================================
RCS file: /sources/nmh/nmh/h/prototypes.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- h/prototypes.h      2 Jun 2008 22:05:11 -0000       1.23
+++ h/prototypes.h      2 Jun 2008 22:37:01 -0000       1.24
@@ -2,7 +2,7 @@
 /*
  * prototypes.h -- various prototypes
  *
- * $Id: prototypes.h,v 1.23 2008/06/02 22:05:11 pm215 Exp $
+ * $Id: prototypes.h,v 1.24 2008/06/02 22:37:01 pm215 Exp $
  */
 
 /*
@@ -25,7 +25,7 @@
 /*
  * 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 *, ...);

Index: sbr/done.c
===================================================================
RCS file: /sources/nmh/nmh/sbr/done.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- sbr/done.c  4 Nov 2007 11:54:33 -0000       1.5
+++ sbr/done.c  2 Jun 2008 22:37:01 -0000       1.6
@@ -2,7 +2,7 @@
 /*
  * done.c -- terminate the program
  *
- * $Id: done.c,v 1.5 2007/11/04 11:54:33 jjr Exp $
+ * $Id: done.c,v 1.6 2008/06/02 22:37:01 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -11,4 +11,4 @@
 
 #include <h/mh.h>
 
-void (*done) (int) = exit;
+void (*done) (int) NORETURN = exit;

Index: uip/inc.c
===================================================================
RCS file: /sources/nmh/nmh/uip/inc.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- uip/inc.c   4 Nov 2007 11:54:34 -0000       1.26
+++ uip/inc.c   2 Jun 2008 22:37:01 -0000       1.27
@@ -2,7 +2,7 @@
 /*
  * inc.c -- incorporate messages from a maildrop into a folder
  *
- * $Id: inc.c,v 1.26 2007/11/04 11:54:34 jjr Exp $
+ * $Id: inc.c,v 1.27 2008/06/02 22:37:01 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -223,7 +223,7 @@
  */
 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 *);

Index: uip/mhbuild.c
===================================================================
RCS file: /sources/nmh/nmh/uip/mhbuild.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- uip/mhbuild.c       4 Nov 2007 11:54:34 -0000       1.12
+++ uip/mhbuild.c       2 Jun 2008 22:37:01 -0000       1.13
@@ -2,7 +2,7 @@
 /*
  * mhbuild.c -- expand/translate MIME composition files
  *
- * $Id: mhbuild.c,v 1.12 2007/11/04 11:54:34 jjr Exp $
+ * $Id: mhbuild.c,v 1.13 2008/06/02 22:37:01 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -100,7 +100,7 @@
 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 *);

Index: uip/mhlist.c
===================================================================
RCS file: /sources/nmh/nmh/uip/mhlist.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- uip/mhlist.c        4 Nov 2007 11:54:34 -0000       1.15
+++ uip/mhlist.c        2 Jun 2008 22:37:01 -0000       1.16
@@ -2,7 +2,7 @@
 /*
  * mhlist.c -- list the contents of MIME messages
  *
- * $Id: mhlist.c,v 1.15 2007/11/04 11:54:34 jjr Exp $
+ * $Id: mhlist.c,v 1.16 2008/06/02 22:37:01 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -110,7 +110,7 @@
 /* mhfree.c */
 void free_content (CT);
 extern CT *cts;
-void freects_done (int);
+void freects_done (int) NORETURN;
 
 /*
  * static prototypes

Index: uip/mhn.c
===================================================================
RCS file: /sources/nmh/nmh/uip/mhn.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- uip/mhn.c   4 Nov 2007 11:54:34 -0000       1.15
+++ uip/mhn.c   2 Jun 2008 22:37:02 -0000       1.16
@@ -2,7 +2,7 @@
 /*
  * mhn.c -- display, list, cache, or store the contents of MIME messages
  *
- * $Id: mhn.c,v 1.15 2007/11/04 11:54:34 jjr Exp $
+ * $Id: mhn.c,v 1.16 2008/06/02 22:37:02 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -198,7 +198,7 @@
 /* mhfree.c */
 void free_content (CT);
 extern CT *cts;
-void freects_done (int);
+void freects_done (int) NORETURN;
 
 /*
  * static prototypes

Index: uip/mhshow.c
===================================================================
RCS file: /sources/nmh/nmh/uip/mhshow.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- uip/mhshow.c        4 Nov 2007 11:54:35 -0000       1.15
+++ uip/mhshow.c        2 Jun 2008 22:37:02 -0000       1.16
@@ -2,7 +2,7 @@
 /*
  * mhshow.c -- display the contents of MIME messages
  *
- * $Id: mhshow.c,v 1.15 2007/11/04 11:54:35 jjr Exp $
+ * $Id: mhshow.c,v 1.16 2008/06/02 22:37:02 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -126,7 +126,7 @@
 /* mhfree.c */
 void free_content (CT);
 extern CT *cts;
-void freects_done (int);
+void freects_done (int) NORETURN;
 
 /*
  * static prototypes

Index: uip/mhstore.c
===================================================================
RCS file: /sources/nmh/nmh/uip/mhstore.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- uip/mhstore.c       4 Nov 2007 11:54:35 -0000       1.15
+++ uip/mhstore.c       2 Jun 2008 22:37:02 -0000       1.16
@@ -2,7 +2,7 @@
 /*
  * mhstore.c -- store the contents of MIME messages
  *
- * $Id: mhstore.c,v 1.15 2007/11/04 11:54:35 jjr Exp $
+ * $Id: mhstore.c,v 1.16 2008/06/02 22:37:02 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -104,7 +104,7 @@
 /* mhfree.c */
 void free_content (CT);
 extern CT *cts;
-void freects_done (int);
+void freects_done (int) NORETURN;
 
 /*
  * static prototypes

Index: uip/mhtest.c
===================================================================
RCS file: /sources/nmh/nmh/uip/mhtest.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- uip/mhtest.c        4 Nov 2007 11:54:35 -0000       1.15
+++ uip/mhtest.c        2 Jun 2008 22:37:02 -0000       1.16
@@ -2,7 +2,7 @@
 /*
  * mhtest.c -- test harness for MIME routines
  *
- * $Id: mhtest.c,v 1.15 2007/11/04 11:54:35 jjr Exp $
+ * $Id: mhtest.c,v 1.16 2008/06/02 22:37:02 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -106,7 +106,7 @@
 /* mhfree.c */
 void free_content (CT);
 extern CT *cts;
-void freects_done (int);
+void freects_done (int) NORETURN;
 
 /*
  * static prototypes

Index: uip/packf.c
===================================================================
RCS file: /sources/nmh/nmh/uip/packf.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- uip/packf.c 4 Nov 2007 11:54:35 -0000       1.11
+++ uip/packf.c 2 Jun 2008 22:37:02 -0000       1.12
@@ -2,7 +2,7 @@
 /*
  * packf.c -- pack a nmh folder into a file
  *
- * $Id: packf.c,v 1.11 2007/11/04 11:54:35 jjr Exp $
+ * $Id: packf.c,v 1.12 2008/06/02 22:37:02 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -33,7 +33,7 @@
 static int mbx_style = MBOX_FORMAT;
 static int mapping = 0;
 
-static void mbxclose_done(int);
+static void mbxclose_done(int) NORETURN;
 
 char *file = NULL;
 

Index: uip/pick.c
===================================================================
RCS file: /sources/nmh/nmh/uip/pick.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- uip/pick.c  4 Nov 2007 11:54:35 -0000       1.12
+++ uip/pick.c  2 Jun 2008 22:37:02 -0000       1.13
@@ -2,7 +2,7 @@
 /*
  * pick.c -- search for messages by content
  *
- * $Id: pick.c,v 1.12 2007/11/04 11:54:35 jjr Exp $
+ * $Id: pick.c,v 1.13 2008/06/02 22:37:02 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -68,7 +68,7 @@
 
 static int listsw = -1;
 
-static void putzero_done (int);
+static void putzero_done (int) NORETURN;
 
 int
 main (int argc, char **argv)

Index: uip/rcvdist.c
===================================================================
RCS file: /sources/nmh/nmh/uip/rcvdist.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- uip/rcvdist.c       4 Nov 2007 11:54:35 -0000       1.12
+++ uip/rcvdist.c       2 Jun 2008 22:37:02 -0000       1.13
@@ -2,7 +2,7 @@
 /*
  * rcvdist.c -- asynchronously redistribute messages
  *
- * $Id: rcvdist.c,v 1.12 2007/11/04 11:54:35 jjr Exp $
+ * $Id: rcvdist.c,v 1.13 2008/06/02 22:37:02 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -34,7 +34,7 @@
  * prototypes
  */
 static void rcvdistout (FILE *, char *, char *);
-static void unlink_done (int);
+static void unlink_done (int) NORETURN;
 
 
 int

Index: uip/rcvstore.c
===================================================================
RCS file: /sources/nmh/nmh/uip/rcvstore.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- uip/rcvstore.c      4 Nov 2007 11:54:36 -0000       1.13
+++ uip/rcvstore.c      2 Jun 2008 22:37:02 -0000       1.14
@@ -2,7 +2,7 @@
 /*
  * rcvstore.c -- asynchronously add mail to a folder
  *
- * $Id: rcvstore.c,v 1.13 2007/11/04 11:54:36 jjr Exp $
+ * $Id: rcvstore.c,v 1.14 2008/06/02 22:37:02 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -48,7 +48,7 @@
  */
 static char *tmpfilenam = NULL;
 
-static void unlink_done(int);
+static void unlink_done(int) NORETURN;
 
 int
 main (int argc, char **argv)

Index: uip/sendsbr.c
===================================================================
RCS file: /sources/nmh/nmh/uip/sendsbr.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- uip/sendsbr.c       4 Nov 2007 11:54:36 -0000       1.17
+++ uip/sendsbr.c       2 Jun 2008 22:37:02 -0000       1.18
@@ -2,7 +2,7 @@
 /*
  * sendsbr.c -- routines to help WhatNow/Send along
  *
- * $Id: sendsbr.c,v 1.17 2007/11/04 11:54:36 jjr Exp $
+ * $Id: sendsbr.c,v 1.18 2008/06/02 22:37:02 pm215 Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -60,7 +60,7 @@
 /*
  * 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 *);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]