cyb70289 commented on a change in pull request #9841: URL: https://github.com/apache/arrow/pull/9841#discussion_r609198081
########## File path: cpp/src/arrow/compute/kernels/scalar_arithmetic.cc ########## @@ -233,6 +236,104 @@ struct DivideChecked { } }; +template <typename T> +inline T integer_power(KernelContext* ctx, T left, T right) { + if (right < 0) { + ctx->SetStatus( + Status::Invalid("integers to negative integer powers are not allowed")); + } + T result = 1; + if (left == 0 && right != 0) { + return 0; + } + while (true) { + if (right % 2) { + result *= left; Review comment: It should work only by enabling this flag. Maybe you need to delete all files before running cmake again. I don't know. To verify, you can build with `ninja -v` and check the command line if `-fsanitize=undefined` is there. You can also check the CI job logs to see what flags it enabled in building. -- 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: us...@infra.apache.org