From: Ken Hornstein Date: Fri, 13 Jan 2012 17:05:13 +0000 (-0500) Subject: Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=93cf33c07eed0e56b4f3a0d1c07ff183ac1510ef;hp=c3ed95b3c5530b84a73dbdd531cb9aca9ba8dea0;p=mmh Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh --- diff --git a/configure.ac b/configure.ac index 43a1029..28821ae 100644 --- a/configure.ac +++ b/configure.ac @@ -218,6 +218,20 @@ fi AC_PROG_CC +AC_CACHE_CHECK(whether preprocessor supports -Wunused-macros, + nmh_cv_has_unusedmacros, + [nmh_saved_cppflags="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -Wunused-macros -Wno-unused-macros" + AC_TRY_COMPILE([],[],nmh_cv_has_unusedmacros=yes,nmh_cv_has_unusedmacros=no) + CPPFLAGS="$nmh_saved_cppflags"]) + +if test "$nmh_cv_has_unusedmacros" = 'yes'; then + test -z "$CPPLAGS" && CPPFLAGS=-Wunused-macros \ + || CPPFLAGS="$CPPFLAGS -Wunused-macros" + DISABLE_UNUSED_MACROS_WARNING=-Wno-unused-macros +fi +AC_SUBST(DISABLE_UNUSED_MACROS_WARNING)dnl + AC_CACHE_CHECK(whether compiler supports -Wno-pointer-sign, nmh_cv_has_noptrsign, [nmh_saved_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wno-pointer-sign" @@ -456,7 +470,8 @@ dnl before system header files. case "$target_os" in linux*) # Like DEFS, but doesn't get stomped on by configure when using config.h: - OURDEFS="$OURDEFS -D_GNU_SOURCE" + test -z "$OURDEFS" && OURDEFS="-D_GNU_SOURCE" \ + || OURDEFS="$OURDEFS -D_GNU_SOURCE" ;; esac AC_SUBST(OURDEFS) diff --git a/h/mh.h b/h/mh.h index e3a382a..b0a841a 100644 --- a/h/mh.h +++ b/h/mh.h @@ -32,8 +32,10 @@ typedef unsigned char boolean; /* not int so we can pack in a structure */ */ #if __GNUC__ > 2 #define NORETURN __attribute__((__noreturn__)) +#define NMH_UNUSED(i) (void) i #else #define NORETURN +#define NMH_UNUSED(i) i #endif /* diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index caa1c73..df1dbbf 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -396,6 +396,8 @@ smtp_init (char *client, char *server, char *port, int watch, int verbose, return RP_RPLY; } } +#else /* TLS_SUPPORT */ + NMH_UNUSED (tls); #endif /* TLS_SUPPORT */ #ifdef CYRUS_SASL @@ -1121,6 +1123,8 @@ static int sm_get_pass(sasl_conn_t *conn, void *context, int id, sasl_secret_t **psecret) { + NMH_UNUSED (conn); + char **pw_context = (char **) context; char *pass = NULL; int len; @@ -1666,6 +1670,8 @@ sm_rerror (int rc) static void alrmser (int i) { + NMH_UNUSED (i); + #ifndef RELIABLE_SIGNALS SIGNAL (SIGALRM, alrmser); #endif diff --git a/sbr/Makefile.in b/sbr/Makefile.in index 555d031..c949469 100644 --- a/sbr/Makefile.in +++ b/sbr/Makefile.in @@ -16,6 +16,7 @@ etcdir = @sysconfdir@ CC = @CC@ CFLAGS = @CFLAGS@ +DISABLE_UNUSED_MACROS_WARNING = @DISABLE_UNUSED_MACROS_WARNING@ DEFS = @DEFS@ CONFIGDEFS = -DNMHETCDIR='"$(etcdir)"' -DMAILSPOOL='"$(mailspool)"' -DSENDMAILPATH='"$(sendmailpath)"' INCLUDES = -I. -I$(top_srcdir) @CPPFLAGS@ @@ -39,7 +40,7 @@ COMPILE2 = $(CC) -c $(DEFS) $(CONFIGDEFS) $(INCLUDES) $(CFLAGS) .SUFFIXES: -.SUFFIXES: .c .o +.SUFFIXES: .c .o .lex .c.o: $(COMPILE) $< @@ -97,8 +98,9 @@ lint: sigmsg.h # some lexes will only accept '-n -t', not '-nt'. # Also, not all makes accept $< in non-pattern rules, # hence the explicit filenames here. -dtimep.c: dtimep.lex +dtimep.o: dtimep.lex $(LEX) -n -t $(srcdir)/dtimep.lex > dtimep.c + $(COMPILE) $(DISABLE_UNUSED_MACROS_WARNING) dtimep.c client.o: client.c $(COMPILE2) $(srcdir)/client.c diff --git a/sbr/getans.c b/sbr/getans.c index 5c70ba0..173e1b4 100644 --- a/sbr/getans.c +++ b/sbr/getans.c @@ -70,6 +70,8 @@ getans (char *prompt, struct swit *ansp) static void intrser (int i) { + NMH_UNUSED (i); + /* * should this be siglongjmp? */ diff --git a/sbr/lock_file.c b/sbr/lock_file.c index c7dffcf..d378749 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -167,6 +167,8 @@ lkclose (int fd, char *file) lockfile_remove(lkinfo.curlock); #endif /* HAVE_LIBLOCKFILE */ timerOFF (fd); /* turn off lock timer */ +#else /* DOT_LOCKING */ + NMH_UNUSED (file); #endif /* DOT_LOCKING */ return (close (fd)); @@ -258,6 +260,8 @@ lkfclose (FILE *fp, char *file) lockfile_remove(lkinfo.curlock); #endif /* HAVE_LIBLOCKFILE */ timerOFF (fileno(fp)); /* turn off lock timer */ +#else /* DOT_LOCKING */ + NMH_UNUSED (file); #endif /* DOT_LOCKING */ return (fclose (fp)); diff --git a/sbr/mts.c b/sbr/mts.c index 6e19bd1..834579d 100644 --- a/sbr/mts.c +++ b/sbr/mts.c @@ -141,6 +141,8 @@ static struct bind binds[] = { void mts_init (char *name) { + NMH_UNUSED (name); + const char *cp; FILE *fp; static int inited = 0; diff --git a/uip/folder.c b/uip/folder.c index 3e7c85d..f3b4ba4 100644 --- a/uip/folder.c +++ b/uip/folder.c @@ -457,6 +457,8 @@ get_folder_info_body (char *fold, char *msg, boolean *crawl_children) static boolean get_folder_info_callback (char *fold, void *baton) { + NMH_UNUSED (baton); + boolean crawl_children; get_folder_info_body (fold, NULL, &crawl_children); fflush (stdout); diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 4cd3770..a0d1306 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -1447,6 +1447,8 @@ putch (char ch) static void intrser (int i) { + NMH_UNUSED (i); + discard (stdout); putchar ('\n'); longjmp (env, DONE); @@ -1456,6 +1458,8 @@ intrser (int i) static void pipeser (int i) { + NMH_UNUSED (i); + done (NOTOK); } @@ -1463,6 +1467,8 @@ pipeser (int i) static void quitser (int i) { + NMH_UNUSED (i); + putchar ('\n'); fflush (stdout); done (NOTOK); diff --git a/uip/mhparse.c b/uip/mhparse.c index 4959dfe..1b49efd 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -1042,6 +1042,8 @@ invalid: static int InitGeneric (CT ct) { + NMH_UNUSED (ct); + return OK; /* not much to do here */ } diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 5225825..44371f1 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -1051,6 +1051,9 @@ show_message_rfc822 (CT ct, int serial, int alternate) static int show_partial (CT ct, int serial, int alternate) { + NMH_UNUSED (serial); + NMH_UNUSED (alternate); + content_error (NULL, ct, "in order to display this message, you must reassemble it"); return NOTOK; @@ -1084,6 +1087,8 @@ show_external (CT ct, int serial, int alternate) static void intrser (int i) { + NMH_UNUSED (i); + putchar ('\n'); siglongjmp (intrenv, DONE); } diff --git a/uip/msh.c b/uip/msh.c index 3a5cc97..2339821 100644 --- a/uip/msh.c +++ b/uip/msh.c @@ -805,6 +805,7 @@ m_gMsgs (int n) FILE * msh_ready (int msgnum, int full) { + NMH_UNUSED (full); register int msgp; int fd; char *cp; @@ -1582,6 +1583,7 @@ seq_setcur (struct msgs *mp, int msgnum) static void intrser (int i) { + NMH_UNUSED (i); discard (stdout); interrupted++; } @@ -1590,6 +1592,7 @@ intrser (int i) static void pipeser (int i) { + NMH_UNUSED (i); if (broken_pipe++ == 0) fprintf (stderr, "broken pipe\n"); told_to_quit++; @@ -1600,6 +1603,7 @@ pipeser (int i) static void quitser (int i) { + NMH_UNUSED (i); told_to_quit++; interrupted++; } @@ -1608,6 +1612,7 @@ quitser (int i) static void alrmser (int i) { + NMH_UNUSED (i); longjmp (peerenv, DONE); } @@ -1672,6 +1677,7 @@ pINI (void) static int pQRY (char *str, int scansw) { + NMH_UNUSED (str); if (pQRY1 (scansw) == NOTOK || pQRY2 () == NOTOK) return NOTOK; diff --git a/uip/mshcmds.c b/uip/mshcmds.c index 64957e8..b46f753 100644 --- a/uip/mshcmds.c +++ b/uip/mshcmds.c @@ -1086,6 +1086,8 @@ static char *hlpmsg[] = { void helpcmd (char **args) { + NMH_UNUSED (args); + int i; for (i = 0; hlpmsg[i]; i++) { @@ -2366,6 +2368,8 @@ show (int msgnum) static int eom_action (int c) { + NMH_UNUSED (c); + return (ftell (mhlfp) >= Msgs[mhlnum].m_stop); } diff --git a/uip/picksbr.c b/uip/picksbr.c index 4afd094..85bc4bc 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -656,6 +656,8 @@ static int GREPaction (params) plist { + NMH_UNUSED (msgnum); + int c, body, lf; long pos = start; register char *p1, *p2, *ebp, *cbp; @@ -929,6 +931,8 @@ static int TWSaction (params) plist { + NMH_UNUSED (stop); + int state; register char *bp; char buf[BUFSIZ], name[NAMESZ]; diff --git a/uip/post.c b/uip/post.c index 515e1d5..2048228 100644 --- a/uip/post.c +++ b/uip/post.c @@ -1608,6 +1608,8 @@ do_text (char *file, int fd) static void sigser (int i) { + NMH_UNUSED (i); + unlink (tmpfil); if (msgflags & MINV) unlink (bccfil); diff --git a/uip/prompter.c b/uip/prompter.c index a016c1f..981e820 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -396,6 +396,8 @@ getln (char *buffer, int n) static void intrser (int i) { + NMH_UNUSED (i); + if (wtuser) longjmp (sigenv, NOTOK); sigint++; diff --git a/uip/rcvtty.c b/uip/rcvtty.c index 5a3093b..74d19d5 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -207,6 +207,8 @@ main (int argc, char **argv) static void alrmser (int i) { + NMH_UNUSED (i); + longjmp (myctx, 1); } diff --git a/uip/replsbr.c b/uip/replsbr.c index 9ca0bb9..7f0f523 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -71,6 +71,8 @@ void replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, int mime, char *form, char *filter, char *fcc) { + NMH_UNUSED (msg); + register int state, i; register struct comp *cptr; register char *tmpbuf; diff --git a/uip/slocal.c b/uip/slocal.c index 36a25f0..f08f2ff 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -1210,6 +1210,8 @@ usr_pipe (int fd, char *cmd, char *pgm, char **vec, int suppress) static void alrmser (int i) { + NMH_UNUSED (i); + longjmp (myctx, DONE); }