8000 MAINT: default to C11 rather than C99, fix most build warnings with Clang 14 by rgommers · Pull Request #25072 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: default to C11 rather than C99, fix most build warnings with Clang 14 #25072

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

Merged
merged 7 commits into from
Dec 13, 2023
Prev Previous commit
Next Next commit
MAINT: fix comparison in npysort/selection.cpp so it doesn't emit a w…
…arning

That warning was, with clang on macOS:
```
../numpy/_core/src/npysort/selection.cpp:529:15: warning: result of comparison of constant 1 with expression of type 'NPY_SELECTKIND' is always false [-Wtautological-constant-out-of-range-compare]
    if (which >= NPY_NSELECTS) {
```
  • Loading branch information
rgommers committed Dec 13, 2023
commit b043ff6d32a298dc27fb0cdfced39b096f0912b8
2 changes: 1 addition & 1 deletion numpy/_core/src/npysort/selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ _get_partition_func(int type, NPY_SELECTKIND which)
npy_intp i;
npy_intp ntypes = partition_t::map.size();

if (which >= NPY_NSELECTS) {
if ((int)which < 0 || (int)which >= NPY_NSELECTS) {
return NULL;
}
for (i = 0; i < ntypes; i++) {
Expand Down
0