-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BLD: fix build warnings #26757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BLD: fix build warnings #26757
Conversation
Codecov Report
@@ Coverage Diff @@
## master #26757 +/- ##
==========================================
- Coverage 91.71% 91.7% -0.01%
==========================================
Files 178 178
Lines 50740 50740
==========================================
- Hits 46538 46533 -5
- Misses 4202 4207 +5
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26757 +/- ##
=========================================
+ Coverage 90.35% 91.76% +1.4%
=========================================
Files 178 178
Lines 50753 50753
=========================================
+ Hits 45859 46571 +712
+ Misses 4894 4182 -712
Continue to review full report at Codecov.
|
Hmm understood that these would never be negative but since Py_ssize_t is what Python would use for indexing that still seems like the more natural data type to use. Is there not a way to silence these warnings while still using that type for indexers? |
@scoder any thoughts on whether this is worthwhile and if not, how to silence the warnings? |
I think As for a work-around for now, it's probably best to explicitly cast the return values to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are consistently using Py_ssize_t, adding in size_t is confusing.
Updated to use Py_ssize_t consistently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import comment, otherwise lgtm. ping on green.
lgtm. merge on green (and close the issues above if this & others cover) |
There's still a bunch in interval.pyx that I'm not sure are purely cosmetic (cc @jschendel) |
thanks @jbrockmendel |
xref #25995, #17936
AFAICT these warnings are caused by cython casting
len(some_ndarray)
toint
orPy_ssize_t
but castinglen(some_memoryview)
tosize_t
. Easiest fix is to declare the affected len variables assize_t
since we know they'll never be negative.