tqchen commented on code in PR #419:
URL: https://github.com/apache/tvm-ffi/pull/419#discussion_r2713517449
##########
include/tvm/ffi/object.h:
##########
@@ -1094,8 +1095,8 @@ struct ObjectUnsafe {
template <typename Class>
TVM_FFI_INLINE static int64_t GetObjectOffsetToSubclass() {
- return
(reinterpret_cast<int64_t>(&(static_cast<Class*>(nullptr)->header_)) -
-
reinterpret_cast<int64_t>(&(static_cast<Object*>(nullptr)->header_)));
+ return static_cast<int64_t>(offsetof(Class, header_)) -
Review Comment:
it is helpful to likely use __builtin_offsetof instead, mainly because it is
more permissive per standard
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]