felipecrv commented on issue #39385:
URL: https://github.com/apache/arrow/issues/39385#issuecomment-1877249853

   `libc++` simply re-exports the global `rename` defined in `stdio.h` to the 
`std::` namespace [1].
   
   I think the C++ standard, when defining `rename` didn't want to guarantee 
`-1` is always returned even though the actual implementation guarantees that.
   
   I wouldn't oppose changing the code from `== -1` to `< 0`, but since we are 
using `#ifdef _WIN32` and not trusting the `rename` provided by Windows via its 
`cstdio`, it's more idiomatic to keep the `rename` without the `std::` for 
POSIX systems. This means we are relying on POSIX and guarding against C++ 
changing `std::rename` in the future (even though the chances of that happening 
are basically 0).
   
   [1] https://github.com/llvm/llvm-project/blob/main/libcxx/include/cstdio#L157


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

Reply via email to