On 25/06/2020 11.25, Peter Maydell wrote:
[...]
+static uint64_t tmr_read(void *opaque, hwaddr addr, unsigned size)
+{

In this function Coverity reports a missing "break" (CID 1429977):

+    case A_TCORA:
+        if (size == 1) {
+            return tmr->tcora[ch];
+        } else if (ch == 0) {
+            return concat_reg(tmr->tcora);
+        }

Here execution can fall through but there is no 'break' or '/* fallthrough */'.

Should we maybe start compiling with -Wimplicit-fallthrough if the compiler supports it, so that we do not always catch these problems after they have been merged?

 Thomas


Reply via email to