summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-03-05 11:44:37 +0000
committerDavid Mitchell <davem@iabyn.com>2015-03-05 11:51:17 +0000
commit2b5060aeb95612aea17de446e9d72793e28bf8a9 (patch)
tree74f80e0051d4dfeec8379bc455486654ab7c43cf /perl.c
parent010725738074e6477ae945076c10bb2d2042390d (diff)
downloadperl-2b5060aeb95612aea17de446e9d72793e28bf8a9.tar.gz
sprinkle NOTREACHED and FALLTHROUGH
Coverity complains bitterly about many switch statements in lots of files. Many of these are of the form: case FOO: ... goto baz; case BAR: .... and something as smart as Coverity shouldn't really be complaining about a missing 'break' when the last statement of the previous branch is an unconditional goto/return/continue. But I've shoved in a bunch of 'NOTREACHED' to hopefully shut it up. Missing 'FALLTHROUGH' comments were more reasonable, and I've added them where appropriate. The only confusing one was cx_dup(), where the various CXt_LOOP_ branches all fell through to the next one, and it took a while to figure out that those weren't bugs.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index d41ebedc97..1a603ae663 100644
--- a/perl.c
+++ b/perl.c
@@ -3206,9 +3206,12 @@ Perl_moreswitches(pTHX_ const char *s)
for (s++; isWORDCHAR(*s); s++) ;
#endif
return s;
+ NOT_REACHED; /* NOTREACHED */
}
case 'h':
usage();
+ NOT_REACHED; /* NOTREACHED */
+
case 'i':
Safefree(PL_inplace);
#if defined(__CYGWIN__) /* do backup extension automagically */