Use reinterpret_cast and nullptr in pythoncapi_compat.h#3237
Use reinterpret_cast and nullptr in pythoncapi_compat.h#3237oleksiyskononenko merged 1 commit intoh2oai:mainfrom vstinner:cpp_cast
reinterpret_cast and nullptr in pythoncapi_compat.h#3237Conversation
|
Thanks, now I don't see any warnings produced by |
|
I was awaiting until the CIs completed for checking for warnings. Thanks for checking for me! The PR is now ready for review ;-) I updated datatable copy of pythoncapi_compat.h. I already merged the C++ compatibility in pythoncapi_compat ;-) |
reinterpret_cast and nullptr in pythoncapi_compat.h
That's great :-) I tried many options to avoid emitting warnings when including this file in C++. I still don't get why some pythoncapi_compat.h functions emit warnings, whereas Python.h doesn't. It seems like "old-style cast" is triggered when a static function implements a cast inside the static inline function used in C++. I don't understand if it only emits a warning if the function is used or not. |
Adjust
pythoncapi_compat.hto produce no warnings in C++ compilers.