You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++] Conflict between arrow::compute::MemAllocation::PREALLOCATE and system header vnode.h preprocessor define #38709
Describe the bug, including details regarding any error messages, version, and platform.
Hi,
On MacOSX the system header vnode.h defines the symbol PREALLOCATE as a preprocessor define. This causes a compilation error with #include <arrow/compute/kernel.h> where this name (PREALLOCATE) is used as an identifier , if sys/vnode.h and arrow/compute/kernel.h are both (possibly indirectly) included into the same compilation unit.
Perhaps the PREALLOCATE symbol should be #undef in arrow/compute/kernel.h in case it is defined as preprocessor macro - e.g.,
#if defined(__APPLE__) and defined(PREALLOCATE)
# undef PREALLOCATE
#endif
changed the title [-]Conflict between `arrow::compute::MemAllocation::PREALLOCATE` and system header `vnode.h` preprocessor define[/-][+][C++] Conflict between `arrow::compute::MemAllocation::PREALLOCATE` and system header `vnode.h` preprocessor define[/+]on Nov 14, 2023
I think I would suggest to use the kPreallocate approach, as it is much less likely to cause conflicts. However, I would worry a little about backward compatibility with existing client code.
I made a PR. If you choose the kPreallocate route, then just kill the PR.
Activity
[-]Conflict between `arrow::compute::MemAllocation::PREALLOCATE` and system header `vnode.h` preprocessor define[/-][+][C++] Conflict between `arrow::compute::MemAllocation::PREALLOCATE` and system header `vnode.h` preprocessor define[/+]kou commentedon Nov 16, 2023
Could you open a pull request with the approach?
Or we can use
kPreallocatename because our coding style uses the convention: https://google.github.io/styleguide/cppguide.html#Enumerator_NamesBut it breaks backward compatibility and our many existing source codes don't follow the convention...
cholmcc commentedon Nov 16, 2023
Hi,
I think I would suggest to use the
kPreallocateapproach, as it is much less likely to cause conflicts. However, I would worry a little about backward compatibility with existing client code.I made a PR. If you choose the
kPreallocateroute, then just kill the PR.Yours,
Christian
kou commentedon Nov 17, 2023
Let's choose
undefapproach for now.It seems that a PR isn't made yet. Could you ensure opening a PR with the change?
cholmcc commentedon Nov 17, 2023
Sorry, my bad - forgot to hit the button :-) The PR is here
GH-38709: [C++] Protect against PREALLOCATE preprocessor defined on m…
apacheGH-38709: [C++] Protect against PREALLOCATE preprocessor define…