cconvey commented on code in PR #11245:
URL: https://github.com/apache/tvm/pull/11245#discussion_r868381104


##########
src/runtime/hexagon/rpc/simulator/session.cc:
##########
@@ -483,7 +483,13 @@ std::string SimulatorRPCChannel::Message_::str() const {
     case Message::kSendEnd:
       return "kSendEnd";
     default:
-      break;
+      LOG(FATAL) << "Internal error: unexpected message code: " << msg.code;
+#if (__GCC__ || __clang__)
+#if __has_builtin(__builtin_unreachable)
+      __builtin_unreachable()
+#endif
+#endif
+          break;

Review Comment:
   Without this, gcc 7.5 was complaining about a code path (`default:`) with no 
return value. This could be awful to debug if it happened, so I don't want to 
simply suppress the compiler warning.



##########
src/runtime/hexagon/rpc/simulator/session.cc:
##########
@@ -483,7 +483,13 @@ std::string SimulatorRPCChannel::Message_::str() const {
     case Message::kSendEnd:
       return "kSendEnd";
     default:
-      break;
+      LOG(FATAL) << "Internal error: unexpected message code: " << msg.code;
+#if (__GCC__ || __clang__)
+#if __has_builtin(__builtin_unreachable)
+      __builtin_unreachable()
+#endif
+#endif
+          break;

Review Comment:
   gcc 7.5 was complaining about a code path (`default:`) with no return value. 
This could be awful to debug if it happened, so I don't want to simply suppress 
the compiler warning.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to