From: David Levine Date: Mon, 27 Feb 2017 03:50:42 +0000 (-0500) Subject: Added /* FALLTHRU */ comments where gcc 7 noticed their need. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/49976f25a761e67a05cc493cc7ab88863a587e30?ds=sidebyside;hp=84ee1e3a7320a9b4b5f40f65f9e969563dfa1443 Added /* FALLTHRU */ comments where gcc 7 noticed their need. And replaced similar comments to be consistent. Used that comment because it satisfies gcc -Wimplicit-fallthrough=4. --- diff --git a/config/config.c b/config/config.c index 020d610d..81c3683f 100644 --- a/config/config.c +++ b/config/config.c @@ -63,7 +63,8 @@ etcpath (char *file) *--cp = '/'; if (access (epath, R_OK) != NOTOK) - return epath; /* else fall */ + return epath; + /* FALLTHRU */ try_it: default: diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 77bcb6e5..78f83556 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -623,7 +623,8 @@ sm_end (int type) case NOTOK: sm_note.code = sm_reply.code; sm_note.length = sm_reply.length; - memcpy (sm_note.text, sm_reply.text, sm_reply.length + 1);/* fall */ + memcpy (sm_note.text, sm_reply.text, sm_reply.length + 1); + /* FALLTHRU */ case DONE: if (smtalk (SM_RSET, "RSET") == 250 && type == DONE) return RP_OK; @@ -764,7 +765,8 @@ sm_wstream (char *buffer, int len) if (netsec_write(nsc, ".", 1, &errstr) != OK) { sm_nerror(errstr); return NOTOK; - } /* FALL THROUGH */ + } + /* FALLTHRU */ default: sm_nl = FALSE; diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index bb6c4f0b..49953f61 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -385,7 +385,8 @@ ismymbox (struct mailname *np) case UUCPHOST: if (strcasecmp (np->m_host, SystemName())) - break; /* fall */ + break; + /* FALLTHRU */ case LOCALHOST: local_test: ; if (!strcasecmp (np->m_mbox, mq.m_mbox)) diff --git a/sbr/cpydgst.c b/sbr/cpydgst.c index 55df3fc6..53923b2a 100644 --- a/sbr/cpydgst.c +++ b/sbr/cpydgst.c @@ -51,8 +51,8 @@ cpydgst (int in, int out, char *ifile, char *ofile) output ('-'); output (' '); } - state = S2; /* fall */ - + state = S2; + /* FALLTHRU */ case S2: output (*cp); if (*cp == '\n') diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index c8618ed8..f7fcff2b 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -578,7 +578,7 @@ do_name(char *sp, int preprocess) ismymbox ((struct mailname *) 0); primed++; } - /* fall through */ + /* FALLTHRU */ case FT_PARSEADDR: if (cm->c_type & CT_DATE) { CERROR("component used as both date and address"); @@ -740,7 +740,7 @@ do_func(char *sp) case TF_EXPR_SV: LV(FT_SAVESTR, 0); - /* fall through */ + /* FALLTHRU */ case TF_EXPR: *--cp = c; cp = do_expr(cp, t->extra); diff --git a/sbr/fmt_new.c b/sbr/fmt_new.c index 18f48987..e5de56f2 100644 --- a/sbr/fmt_new.c +++ b/sbr/fmt_new.c @@ -102,7 +102,8 @@ normalize (char *cp) break; case 0: - cp--; /* fall */ + cp--; + /* FALLTHRU */ default: *dp++ = *cp; break; diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index f640a2aa..4976b1c5 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -606,7 +606,7 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz, while (isspace ((unsigned char) *--cp) && cp >= name) continue; *++cp = 0; /* readpos points to the first character of the field body. */ - /* fall through */ + /* FALLTHRU */ case FLDPLUS: { /* diff --git a/sbr/mf.c b/sbr/mf.c index 084643b4..a604ce91 100644 --- a/sbr/mf.c +++ b/sbr/mf.c @@ -288,6 +288,7 @@ again: ; strcpy (err, "extraneous semi-colon"); return NOTOK; } + /* FALLTHRU */ case LX_COMA: mh_xfree(note); note = NULL; @@ -391,6 +392,7 @@ again: ; strcpy (err, "extraneous semi-colon"); return NOTOK; } + /* FALLTHRU */ case LX_COMA: case LX_END: return OK; @@ -623,6 +625,7 @@ my_lex (char *buffer) continue; case '(': i++; + /* FALLTHRU */ default: ADDCHR(c); continue; @@ -650,6 +653,7 @@ my_lex (char *buffer) cp = NULL; return (last_lex = LX_ERR); } + /* FALLTHRU */ default: ADDCHR(c); continue; @@ -673,6 +677,7 @@ my_lex (char *buffer) cp = NULL; return (last_lex = LX_ERR); } + /* FALLTHRU */ default: ADDCHR(c); continue; @@ -781,7 +786,8 @@ mfgets (FILE *in, char **bp) case '\t': *cp++ = '\n'; break; - } /* fall into default case */ + } + /* FALLTHRU */ default: *cp++ = i; diff --git a/sbr/mts.c b/sbr/mts.c index 285ced5d..9db81061 100644 --- a/sbr/mts.c +++ b/sbr/mts.c @@ -182,6 +182,7 @@ tailor_value (char *s) case 't': *bp = '\t'; break; case 0: s--; + /* FALLTHRU */ case QUOTE: *bp = QUOTE; break; diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index 9784e89e..2bd8d63e 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -80,7 +80,7 @@ ruserpass(const char *host, char **aname, char **apass, int flags) switch(t) { case DEFAULT: usedefault = 1; - /* FALL THROUGH */ + /* FALLTHRU */ case MACH: if (!usedefault) { diff --git a/sbr/seq_read.c b/sbr/seq_read.c index 8b58639a..20ba5cff 100644 --- a/sbr/seq_read.c +++ b/sbr/seq_read.c @@ -104,7 +104,7 @@ seq_public (struct msgs *mp, int lockflag, int *failed_to_lock) case BODY: lkfclosedata (fp, seqfile); adios (NULL, "no blank lines are permitted in %s", seqfile); - /* fall */ + /* FALLTHRU */ case FILEEOF: break; diff --git a/uip/aliasbr.c b/uip/aliasbr.c index e9724f73..015f48a4 100644 --- a/uip/aliasbr.c +++ b/uip/aliasbr.c @@ -202,7 +202,7 @@ alias (char *file) fclose (fp); return i; } - + /* FALLTHRU */ case ':': /* comment */ case ';': case '#': diff --git a/uip/burst.c b/uip/burst.c index 49dad2d1..ab2a9e5d 100644 --- a/uip/burst.c +++ b/uip/burst.c @@ -521,6 +521,7 @@ cpybrst (FILE *in, FILE *out, char *ifile, char *ofile, int len, int mime) default: state = S2; + /* FALLTHRU */ case '\n': fputc (c, out); break; @@ -531,6 +532,7 @@ cpybrst (FILE *in, FILE *out, char *ifile, char *ofile, int len, int mime) switch (c) { case '\n': state = S1; + /* FALLTHRU */ default: fputc (c, out); break; diff --git a/uip/comp.c b/uip/comp.c index a018d743..7ca48dbc 100644 --- a/uip/comp.c +++ b/uip/comp.c @@ -123,7 +123,7 @@ main (int argc, char **argv) case BILDSW: build++; - /* fall through */ + /* FALLTHRU */ case NWHATSW: nwhat++; continue; diff --git a/uip/fmtdump.c b/uip/fmtdump.c index 9a6e351c..a23c21c1 100644 --- a/uip/fmtdump.c +++ b/uip/fmtdump.c @@ -266,6 +266,7 @@ dumpone(struct format *fmt) case FT_IF_MATCH: case FT_IF_AMATCH: printf(" continue else goto"); + /* FALLTHRU */ case FT_GOTO: i = findlabel(fmt + fmt->f_skip); printf(" L%d", i); diff --git a/uip/fmttest.c b/uip/fmttest.c index 80b73d92..cb4c82ea 100644 --- a/uip/fmttest.c +++ b/uip/fmttest.c @@ -649,7 +649,7 @@ process_single_file(FILE *in, struct msgs_array *comps, int *dat, int msgsize, fmt_addcomptext("body", rbuf); } - /* fall through */ + /* FALLTHRU */ default: goto finished; @@ -894,6 +894,7 @@ dumpone(struct format *fmt) case FT_IF_MATCH: case FT_IF_AMATCH: printf(" continue else goto"); + /* FALLTHRU */ case FT_GOTO: i = findlabel(fmt + fmt->f_skip); printf(" L%d", i); diff --git a/uip/forw.c b/uip/forw.c index 5b4d9014..501f6513 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -163,7 +163,8 @@ main (int argc, char **argv) nwhat = 0; continue; case BILDSW: - buildsw++; /* fall... */ + buildsw++; + /* FALLTHRU */ case NWHATSW: nwhat++; continue; diff --git a/uip/inc.c b/uip/inc.c index b32b3e1f..1973a6af 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -690,7 +690,7 @@ go_to_it: trnflag = 0; noisy++; /* advise (cp, "unable to read"); already advised */ - /* fall thru */ + /* FALLTHRU */ case SCNERR: case SCNNUM: @@ -851,7 +851,7 @@ go_to_it: trnflag = 0; noisy++; /* advise (cp, "unable to read"); already advised */ - /* fall thru */ + /* FALLTHRU */ case SCNERR: case SCNNUM: diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 2639043b..c8b8799c 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -343,7 +343,7 @@ finish_field: case BODY: fseek (in, (long) (-strlen (buf)), SEEK_CUR); - /* fall through */ + /* FALLTHRU */ case FILEEOF: break; @@ -809,7 +809,7 @@ rock_and_roll: ct->c_encoding = CE_7BIT; goto call_init; } - /* else fall... */ + /* FALLTHRU */ case CT_MULTIPART: adios (NULL, "it doesn't make sense to define an in-line %s content", ct->c_type == CT_MESSAGE ? "message" : "multipart"); @@ -1288,7 +1288,7 @@ compose_content (CT ct, int verbose) case 'F': /* %f, and stdout is not-redirected */ xstdout = 1; - /* and fall... */ + /* FALLTHRU */ case 'f': /* @@ -2017,7 +2017,7 @@ setup_attach_content(CT ct, char *filename) if (strcasecmp(ct->c_ctinfo.ci_subtype, "external-body") == 0) adios(NULL, "external-body messages must be specified " "by mhbuild directives"); - /* Fall through */ + /* FALLTHRU */ default: /* diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 329ad79e..f07d786d 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -361,16 +361,20 @@ mhl (int argc, char **argv) case AMBIGSW: ambigsw (cp, mhlswitches); mhldone (1); + /* FALLTHRU */ case UNKWNSW: mhladios (NULL, "-%s unknown\n", cp); + /* FALLTHRU */ case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [files ...]", invo_name); print_help (buf, mhlswitches, 1); mhldone (0); + /* FALLTHRU */ case VERSIONSW: print_version(invo_name); mhldone (0); + /* FALLTHRU */ case BELLSW: bellflg = 1; @@ -449,7 +453,8 @@ mhl (int argc, char **argv) continue; case FORW2SW: - forwall++; /* fall */ + forwall++; + /* FALLTHRU */ case FORW1SW: forwflg++; clearflg = -1;/* XXX */ @@ -900,7 +905,7 @@ process (char *folder, char *fname, int ofilen, int ofilec) cp = folder ? concat (folder, ":", fname2, NULL) : mh_xstrdup(fname2); if (ontty != PITTY) SIGNAL (SIGINT, intrser); - mhlfile (fp, cp, ofilen, ofilec); /* FALL THROUGH! */ + mhlfile (fp, cp, ofilen, ofilec); free (cp); for (ap = arglist_head; ap; ap = ap->a_next) { @@ -909,7 +914,8 @@ process (char *folder, char *fname, int ofilen, int ofilec) } if (arglist_head) - fmt_free(NULL, 1); + fmt_free(NULL, 1); + /* FALLTHRU */ default: if (ontty != PITTY) diff --git a/uip/mhparse.c b/uip/mhparse.c index 85c32924..5db4efed 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -960,7 +960,7 @@ invalid: case '(': i++; - /* and fall... */ + /* FALLTHRU */ default: *bp++ = c; continue; @@ -1531,7 +1531,7 @@ no_body: case CT_MESSAGE: if (p->c_subtype != MESSAGE_RFC822) break; - /* else fall... */ + /* FALLTHRU */ default: e->eb_partno = ct->c_partno; if (p->c_ctinitfnx) @@ -3479,7 +3479,7 @@ bad_quote: case '\\': if (*++cp == '\0') goto bad_quote; - /* FALL THROUGH */ + /* FALLTHRU */ default: len++; continue; @@ -3931,7 +3931,7 @@ param_len(PM pm, int index, size_t valueoff, int *encode, int *cont, case '\\': len++; maxfit--; - /* FALL THROUGH */ + /* FALLTHRU */ default: len++; maxfit--; @@ -4039,6 +4039,7 @@ normal_param(PM pm, char *output, size_t len, size_t valuelen, case '"': *output++ = '\\'; outlen++; + /* FALLTHRU */ default: *output++ = *p++; outlen++; diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 7298f5b0..6b2efa88 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -844,7 +844,7 @@ parse_display_string (CT ct, char *cp, int *xstdin, int *xlist, case 'F': /* %f, and stdin is terminal not content */ *xstdin = 1; - /* and fall... */ + /* FALLTHRU */ case 'f': if (multipart) { @@ -898,7 +898,7 @@ parse_display_string (CT ct, char *cp, int *xstdin, int *xlist, case 'p': /* No longer supported */ - /* and fall... */ + /* FALLTHRU */ case 'l': /* display listing prior to displaying content */ diff --git a/uip/new.c b/uip/new.c index 7a1f2347..e2fe81cc 100644 --- a/uip/new.c +++ b/uip/new.c @@ -178,7 +178,7 @@ get_msgnums(char *folder, char *sequences[]) case BODY: adios (NULL, "no blank lines are permitted in %s", seqfile); - /* fall */ + /* FALLTHRU */ case FILEEOF: break; diff --git a/uip/picksbr.c b/uip/picksbr.c index 3d9c5b5b..6faa108f 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -633,6 +633,7 @@ gcompile (struct nexus *n, char *astr) case '\\': if ((c = *sp++) == '\0') goto cerror; + /* FALLTHRU */ defchar: default: *ep++ = CCHR; diff --git a/uip/popsbr.c b/uip/popsbr.c index 16eba46d..ebb9b18f 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -272,7 +272,7 @@ pop_init (char *host, char *port, char *user, char *proxy, int snoop, strncpy (buffer, response, sizeof(buffer)); command ("QUIT"); strncpy (response, buffer, sizeof(response)); - /* and fall */ + /* FALLTHRU */ case NOTOK: case DONE: diff --git a/uip/post.c b/uip/post.c index 385aae20..9973beb7 100644 --- a/uip/post.c +++ b/uip/post.c @@ -1867,6 +1867,7 @@ do_text (char *file, int fd) case RP_NO: case RP_NDEL: die (NULL, "posting failed; %s", rp_string (retval)); + /* FALLTHRU */ default: die (NULL, "unexpected response; %s", rp_string (retval)); diff --git a/uip/rcvdist.c b/uip/rcvdist.c index a8231e91..7a96658e 100644 --- a/uip/rcvdist.c +++ b/uip/rcvdist.c @@ -129,7 +129,8 @@ main (int argc, char **argv) sleep (5); switch (child_id) { case NOTOK: - admonish (NULL, "unable to fork");/* fall */ + admonish (NULL, "unable to fork"); + /* FALLTHRU */ case OK: execvp (program, vec); fprintf (stderr, "unable to exec "); diff --git a/uip/repl.c b/uip/repl.c index 7f0c7bac..15aa0a3a 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -225,7 +225,8 @@ main (int argc, char **argv) nwhat = 0; continue; case BILDSW: - buildsw++; /* fall... */ + buildsw++; + /* FALLTHRU */ case NWHATSW: nwhat++; continue; diff --git a/uip/rmf.c b/uip/rmf.c index 30f94219..6a86fe6a 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -133,7 +133,8 @@ rmf (char *folder) switch (i = chdir (maildir = m_maildir (folder))) { case OK: if (access (".", W_OK) != NOTOK && access ("..", W_OK) != NOTOK) - break; /* fall otherwise */ + break; + /* FALLTHRU */ case NOTOK: snprintf (cur, sizeof(cur), "atr-%s-%s", @@ -162,7 +163,8 @@ rmf (char *folder) case '.': if (strcmp (dp->d_name, ".") == 0 || strcmp (dp->d_name, "..") == 0) - continue; /* else fall */ + continue; + /* FALLTHRU */ case ',': break; diff --git a/uip/scansbr.c b/uip/scansbr.c index 191e69e8..87bcb591 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -273,7 +273,7 @@ body:; state = BODY; goto body; } - /* fall through */ + /* FALLTHRU */ case FILEEOF: goto finished; diff --git a/uip/send.c b/uip/send.c index 2d162a7a..da7532a7 100644 --- a/uip/send.c +++ b/uip/send.c @@ -243,7 +243,8 @@ main (int argc, char **argv) continue; case DEBUGSW: - debugsw++; /* fall */ + debugsw++; + /* FALLTHRU */ case NFILTSW: case FRMTSW: case NFRMTSW: @@ -283,7 +284,7 @@ main (int argc, char **argv) case SASLMECHSW: if (!(saslmech = *argp) || *saslmech == '-') adios (NULL, "missing argument to %s", argp[-1]); - /* Fall through */ + /* FALLTHRU */ case ALIASW: case FILTSW: @@ -483,8 +484,10 @@ go_to_it: switch (sendsbr (vec, vecp, program, msgs[msgnum], &st, 1, auth_svc)) { case DONE: done (++status); + /* FALLTHRU */ case NOTOK: - status++; /* fall */ + status++; + /* FALLTHRU */ case OK: break; } diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 33dd3451..6409aeca 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -522,6 +522,7 @@ alert (char *file, int out) case NOTOK: /* oops -- fork error */ advise ("fork", "unable to"); + /* FALLTHRU */ case OK: /* child process -- send it */ @@ -621,6 +622,7 @@ anno (int fd, struct stat *st) "unable to fork, so doing annotations by hand..."); if (cwd == NULL) cwd = mh_xstrdup(pwd ()); + /* FALLTHRU */ case OK: /* block a few signals */ diff --git a/uip/show.c b/uip/show.c index 9aa84b39..7fb4cfae 100644 --- a/uip/show.c +++ b/uip/show.c @@ -96,6 +96,7 @@ main (int argc, char **argv) goto non_mhl_switches; case NHEADSW: headersw = 0; + /* FALLTHRU */ case CONCATSW: case NCONCATSW: non_mhl_switches: @@ -413,7 +414,7 @@ invalid: continue; case '(': i++; - /* and fall... */ + /* FALLTHRU */ default: continue; case ')': diff --git a/uip/slocal.c b/uip/slocal.c index 0e3baae4..f41b6ad3 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -484,7 +484,8 @@ usr_delivery (int fd, char *delivery, int su) * do this - else fall through */ if (!next) - continue; /* else fall */ + continue; + /* FALLTHRU */ case '?': /* @@ -492,7 +493,8 @@ usr_delivery (int fd, char *delivery, int su) * consider delivered if action is successful. */ if (won) - continue; /* else fall */ + continue; + /* FALLTHRU */ case 'A': case 'a': @@ -538,7 +540,8 @@ usr_delivery (int fd, char *delivery, int su) if (won) continue; break; - } /* else fall */ + } + /* FALLTHRU */ default: /* parse message and build lookup table */ @@ -565,7 +568,8 @@ usr_delivery (int fd, char *delivery, int su) case 'q': /* deliver to quoted pipe */ if (strcasecmp (action, "qpipe")) - continue; /* else fall */ + continue; + /* FALLTHRU */ case '^': expand (tmpbuf, string, fd); if (split (tmpbuf, vec) < 1) @@ -576,7 +580,8 @@ usr_delivery (int fd, char *delivery, int su) case 'p': /* deliver to pipe */ if (strcasecmp (action, "pipe")) - continue; /* else fall */ + continue; + /* FALLTHRU */ case '|': vec[2] = "sh"; vec[3] = "-c"; @@ -594,7 +599,8 @@ usr_delivery (int fd, char *delivery, int su) } /* deliver to nmh folder */ else if (strcasecmp (action, "folder")) - continue; /* else fall */ + continue; + /* FALLTHRU */ case '+': status = usr_folder (fd, string); break; @@ -607,7 +613,8 @@ usr_delivery (int fd, char *delivery, int su) } /* mbox format */ else if (strcasecmp (action, "mbox")) - continue; /* else fall */ + continue; + /* FALLTHRU */ case '>': /* mbox format */ diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 919dd901..61cf45d6 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -834,6 +834,7 @@ sendfile (char **arg, char *file, int pushsw) switch (child_id) { case NOTOK: advise (NULL, "unable to fork, so sending directly..."); + /* FALLTHRU */ case OK: vec = argsplit(sendproc, &program, &vecp); if (pushsw) @@ -1119,7 +1120,8 @@ sendit (char *sp, char **arg, char *file, int pushed) continue; case DEBUGSW: - debugsw++; /* fall */ + debugsw++; + /* FALLTHRU */ case NFILTSW: case FRMTSW: case NFRMTSW: @@ -1159,7 +1161,7 @@ sendit (char *sp, char **arg, char *file, int pushed) case SASLMECHSW: saslmech = *argp; - /* fall thru */ + /* FALLTHRU */ case ALIASW: case FILTSW: case WIDTHSW: @@ -1185,6 +1187,7 @@ sendit (char *sp, char **arg, char *file, int pushed) advise (NULL, "missing argument to %s", argp[-2]); return; } + /* FALLTHRU */ case SNDRFSW: continue; diff --git a/uip/whom.c b/uip/whom.c index 411c4770..4a3f81dc 100644 --- a/uip/whom.c +++ b/uip/whom.c @@ -182,7 +182,8 @@ main (int argc, char **argv) switch (distsw ? child_id : OK) { case NOTOK: - advise (NULL, "unable to fork, so checking directly..."); + advise (NULL, "unable to fork, so checking directly..."); + /* FALLTHRU */ case OK: execvp (postproc, vec); fprintf (stderr, "unable to exec ");