cyb70289 opened a new pull request #9274:
URL: https://github.com/apache/arrow/pull/9274


   Many `invalid-offsetof` warnings in python building:
   ...
   ~/arrow/python/build/temp.linux-x86_64-3.6/_compute.cpp:26034:146:
   warning: offsetof within non-standard-layout type 
‘__pyx_obj_7pyarrow_8_compute__CastOptions’ is undefined [-Winvalid-offsetof]
    x_type_7pyarrow_8_compute__CastOptions.tp_weaklistoffset = offsetof(struct 
__pyx_obj_7pyarrow_8_compute__CastOptions, __pyx_base.__pyx_base.__weakref__);
   ...
   
   Cython generated code calls `offsetof` on FunctionOptions based classes.
   `offsetof` only applies to C++ classes with `standard layout type` [1],
   which excludes virtual functions.
   
   Fix the warning by removing virtual destructor in FunctionOptions class.
   No FunctionOptions derived class has explicit destructor, so removing
   the virtual destructor looks safe now. But it may cause memory leak in
   the future when some derived classes have explicit destructors.
   
   Any better way to handle this issue?
   
   [1] https://en.cppreference.com/w/cpp/named_req/StandardLayoutType


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

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


Reply via email to