nmh-commits
[Top][All Lists]
Advanced

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

[Nmh-commits] nmh ChangeLog sbr/fmt_compile.c


From: Peter Maydell
Subject: [Nmh-commits] nmh ChangeLog sbr/fmt_compile.c
Date: Sun, 03 Aug 2008 15:19:54 +0000

CVSROOT:        /sources/nmh
Module name:    nmh
Changes by:     Peter Maydell <pm215>   08/08/03 15:19:54

Modified files:
        .              : ChangeLog 
        sbr            : fmt_compile.c 

Log message:
        Add protective 'do { ... } while (0)' wrappers to multistatement macros

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/nmh/ChangeLog?cvsroot=nmh&r1=1.281&r2=1.282
http://cvs.savannah.gnu.org/viewcvs/nmh/sbr/fmt_compile.c?cvsroot=nmh&r1=1.9&r2=1.10

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/nmh/nmh/ChangeLog,v
retrieving revision 1.281
retrieving revision 1.282
diff -u -b -r1.281 -r1.282
--- ChangeLog   3 Aug 2008 13:59:20 -0000       1.281
+++ ChangeLog   3 Aug 2008 15:19:53 -0000       1.282
@@ -1,5 +1,17 @@
 2008-08-03  Peter Maydell  <address@hidden>
 
+       * sbr/fmt_compile.c: add 'do { ... } while (0)' wrappers
+       to various multi-statement macros to avoid nasty surprises
+       if the macros are used in if() clauses.
+
+       * bug #23436: man/scan.man, man/forw.man, man/inc.man,
+       man/mh-chart.man, man/mhmail.man, man/mhshow.man,
+       man/mhstore.man, man/msgchk.man, man/packf.man, man/scan.man:
+       fix minor syntax errors groff warns about.
+       * test/runtest, test/README: allow test cases to report
+       that they have been SKIPped as well as PASS/FAIL
+       * test/tests/manpages/test-manpages - new test which runs groff
+       on the manpages and checks that there are no warnings.
        * test/runalltests: ignore editor backup files
 
 2008-08-03  Eric Gillespie  <address@hidden>

Index: sbr/fmt_compile.c
===================================================================
RCS file: /sources/nmh/nmh/sbr/fmt_compile.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- sbr/fmt_compile.c   3 Aug 2008 13:32:17 -0000       1.9
+++ sbr/fmt_compile.c   3 Aug 2008 15:19:54 -0000       1.10
@@ -2,7 +2,7 @@
 /*
  * fmt_compile.c -- "compile" format strings for fmt_scan
  *
- * $Id: fmt_compile.c,v 1.9 2008/08/03 13:32:17 pm215 Exp $
+ * $Id: fmt_compile.c,v 1.10 2008/08/03 15:19:54 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
@@ -158,32 +158,35 @@
 };
 
 /* Add new component to the hash table */
-#define NEWCOMP(cm,name)\
+#define NEWCOMP(cm,name) do { \
        cm = ((struct comp *) calloc(1, sizeof (struct comp)));\
        cm->c_name = name;\
        ncomp++;\
        i = CHASH(name);\
        cm->c_next = wantcomp[i];\
-       wantcomp[i] = cm;
+       wantcomp[i] = cm; \
+       } while (0)
 
 #define NEWFMT (next_fp++)
-#define NEW(type,fill,wid)\
-       fp=NEWFMT; fp->f_type=(type); fp->f_fill=(fill); fp->f_width=(wid);
+#define NEW(type,fill,wid) do {\
+       fp=NEWFMT; fp->f_type=(type); fp->f_fill=(fill); fp->f_width=(wid); \
+       } while (0)
 
 /* Add (possibly new) component to the hash table */
-#define ADDC(name)\
+#define ADDC(name) do { \
        FINDCOMP(cm, name);\
        if (!cm) {\
            NEWCOMP(cm,name);\
        }\
-       fp->f_comp = cm;
+       fp->f_comp = cm; \
+       } while (0)
 
-#define LV(type, value)                NEW(type,0,0); fp->f_value = (value);
-#define LS(type, str)          NEW(type,0,0); fp->f_text = (str);
+#define LV(type, value)                do { NEW(type,0,0); fp->f_value = 
(value); } while (0)
+#define LS(type, str)          do { NEW(type,0,0); fp->f_text = (str); } while 
(0)
 
-#define PUTCOMP(comp)          NEW(FT_COMP,0,0); ADDC(comp);
-#define PUTLIT(str)            NEW(FT_LIT,0,0); fp->f_text = (str);
-#define PUTC(c)                        NEW(FT_CHAR,0,0); fp->f_char = (c);
+#define PUTCOMP(comp)          do { NEW(FT_COMP,0,0); ADDC(comp); } while (0)
+#define PUTLIT(str)            do { NEW(FT_LIT,0,0); fp->f_text = (str); } 
while (0)
+#define PUTC(c)                        do { NEW(FT_CHAR,0,0); fp->f_char = 
(c); } while (0)
 
 static char *format_string;
 static unsigned char *usr_fstring;     /* for CERROR */




reply via email to

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