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/06/14 16:47:44 UTC

[GitHub] [trafficserver] ywkaras commented on a diff in pull request #8911: Override LogField constructor to avoid reinterpret_cast at call site

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


##########
proxy/logging/LogField.cc:
##########
@@ -244,6 +244,12 @@ LogField::LogField(const char *name, const char *symbol, Type type, MarshalFunc
                   strcmp(m_symbol, "cqtn") == 0 || strcmp(m_symbol, "cqtd") == 0 || strcmp(m_symbol, "cqtt") == 0);
 }
 

Review Comment:
   Could you add a comment here like:
   Typical ABIs guarantee that (using reinterpret_cast) it's safe to assign a function address to a function pointer if the function's argument types are a prefix of the argument types of the pointed to function type, and the return types match.  Arguments are nominally pushed onto the top of the stack from last to first.  (In practice, the top locations in the call stack are generally mapped to registers.)  Therefore, the arguments that the function will use are at the same offset from the top of the stack.



-- 
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