You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/05/17 00:35:56 UTC

[GitHub] [trafficserver] ywkaras commented on a diff in pull request #8850: Fix Rocky Linux 8 arm64 GCC Compiler Warnings

ywkaras commented on code in PR #8850:
URL: https://github.com/apache/trafficserver/pull/8850#discussion_r874260319


##########
iocore/eventsystem/I_Continuation.h:
##########
@@ -71,7 +71,7 @@ constexpr ContinuationHandler
 continuation_handler_void_ptr(int (C::*fp)(int, T *))
 {
   auto fp2 = reinterpret_cast<int (C::*)(int, void *)>(fp);
-  return static_cast<ContinuationHandler>(fp2);
+  return reinterpret_cast<ContinuationHandler>(fp2);

Review Comment:
   If we change static_cast to reinterpret_cast, there will no longer be a compile-time check that C is derived from Continuation.  If C isn't we will just see undefined behavior at runtime.  This seem clearly to be a bizarre bug in gcc on Rocky Linux, as there is no shift operator involved.  Can we change it only on Rocky Linux using conditional compilation?



-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org