[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/01: src: Document intentional case fallthrough.
From: |
G. Branden Robinson |
Subject: |
[groff] 01/01: src: Document intentional case fallthrough. |
Date: |
Sun, 12 Nov 2017 10:18:28 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 001e6c139f2ecc6ea8a0476fbbf4fdf5be8f301c
Author: G. Branden Robinson <address@hidden>
Date: Sun Nov 12 10:14:35 2017 -0500
src: Document intentional case fallthrough.
Per discussion with Bjarni Ingi Gislason, this should resolve compiler
warnings from GCC 7 with -Wimplicit-fallthrough. He had to do the
testing for me since I'm still on GCC 6.3 (which doesn't emit these
warnings at all).
Fix most of https://savannah.gnu.org/bugs/?52335.
Signed-off-by: G. Branden Robinson <address@hidden>
---
src/preproc/grn/hdb.cpp | 3 +++
src/roff/groff/groff.cpp | 1 +
2 files changed, 4 insertions(+)
diff --git a/src/preproc/grn/hdb.cpp b/src/preproc/grn/hdb.cpp
index f97dd6b..c61e099 100644
--- a/src/preproc/grn/hdb.cpp
+++ b/src/preproc/grn/hdb.cpp
@@ -245,6 +245,7 @@ DBGetType(register char *s)
return (CENTRIGHT);
default:
fatal("unknown element type");
+ // fatal() does not return
}
case 'B':
switch (s[3]) {
@@ -256,6 +257,7 @@ DBGetType(register char *s)
return (BOTRIGHT);
default:
fatal("unknown element type");
+ // fatal() does not return
}
case 'T':
switch (s[3]) {
@@ -267,6 +269,7 @@ DBGetType(register char *s)
return (TOPRIGHT);
default:
fatal("unknown element type");
+ // fatal() does not return
}
default:
fatal("unknown element type");
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index 46cbf01..bd225fd 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -293,6 +293,7 @@ int main(int argc, char **argv)
break;
case 'o':
oflag = 1;
+ // fall through
case 'f':
case 'm':
case 'r':
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/01: src: Document intentional case fallthrough.,
G. Branden Robinson <=