#985417 hdbm.c: add an attribute for a fall through in case statements

Package:
src:nn
Source:
nn
Submitter:
Bjarni Ingi Gislason
Date:
2021-03-17 20:06:03 UTC
Severity:
normal
Tags:
#985417#5
Date:
2021-03-17 20:02:23 UTC
From:
To:
Dear Maintainer,

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 hdbm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hdbm.c b/hdbm.c
index 1b47644..b5bbf22 100644
--- a/hdbm.c
+++ b/hdbm.c
@@ -91,18 +91,25 @@ hdbmdef(register HDBMDATUM key)
 	    case 0:
 		do {		/* All fall throughs */
 		    HASHC;
+		    __attribute__ ((fallthrough));
 	    case 7:
 		    HASHC;
+		    __attribute__ ((fallthrough));
 	    case 6:
 		    HASHC;
+		    __attribute__ ((fallthrough));
 	    case 5:
 		    HASHC;
+		    __attribute__ ((fallthrough));
 	    case 4:
 		    HASHC;
+		    __attribute__ ((fallthrough));
 	    case 3:
 		    HASHC;
+		    __attribute__ ((fallthrough));
 	    case 2:
 		    HASHC;
+		    __attribute__ ((fallthrough));
 	    case 1:
 		    HASHC;
 		} while (--loop);