Reorder cases to avoid fall-through warning
authorXiretza <xiretza@xiretza.xyz>
Thu, 7 May 2020 09:44:38 +0000 (11:44 +0200)
committerXiretza <xiretza@xiretza.xyz>
Thu, 7 May 2020 11:39:34 +0000 (13:39 +0200)
log_assert(false) never returns and thus can't fall through, but gcc
doesn't seem to think that far. Making it the last case avoids the
problem entirely.

backends/cxxrtl/cxxrtl.cc

index 133f5666337a8472c4c2070c7bcccb3894185187..f3ed3f6232542807ff920cfc3e4a4d1590900556 100644 (file)
@@ -1943,13 +1943,13 @@ struct CxxrtlWorker {
                                                case RTLIL::STa:
                                                        break;
 
+                                               case RTLIL::STg:
+                                                       log_cmd_error("Global clock is not supported.\n");
+
                                                // Handling of init-type sync rules is delegated to the `proc_init` pass, so we can use the wire
                                                // attribute regardless of input.
                                                case RTLIL::STi:
                                                        log_assert(false);
-
-                                               case RTLIL::STg:
-                                                       log_cmd_error("Global clock is not supported.\n");
                                        }
                        }