Skip to content

Add explicit casts to avoid compiler warnings#1294

Merged
wjakob merged 1 commit intowjakob:masterfrom
hpkfft:master
Feb 20, 2026
Merged

Add explicit casts to avoid compiler warnings#1294
wjakob merged 1 commit intowjakob:masterfrom
hpkfft:master

Conversation

@hpkfft
Copy link
Contributor

@hpkfft hpkfft commented Feb 17, 2026

As seen in https://github.com/wjakob/nanobind/actions/runs/22058320272/job/63731838031
GCC complains, comparison of constant ‘1’ with boolean expression is always false [-Wbool-compare]

Also, MinGW complains:

D:/a/nanobind/nanobind/src/nb_ndarray.cpp:274:27: warning: comparison of integer expressions of different signedness: 'long int' and 'const uint32_t' {aka 'const unsigned int'} [-Wsign-compare]
  274 |     if (max_major_version >= dlpack::major_version)
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

This PR makes the compilers happy.

@hpkfft hpkfft mentioned this pull request Feb 17, 2026
@wjakob wjakob merged commit 43a84e3 into wjakob:master Feb 20, 2026
28 checks passed
@wjakob
Copy link
Owner

wjakob commented Feb 20, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants