Skip to content
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

Warning "event->paxis.axis >= 0" always true #11410

Open
1bsyl opened this issue Nov 4, 2024 · 1 comment
Open

Warning "event->paxis.axis >= 0" always true #11410

1bsyl opened this issue Nov 4, 2024 · 1 comment
Assignees
Milestone

Comments

@1bsyl
Copy link
Contributor

1bsyl commented Nov 4, 2024

Maybe a minor warning to ignore, or "axis" variable could be as well turned into a signed type

src/events/SDL_events.c:733:48: warning: result of comparison of unsigned enum expression >= 0 is always true [-Wtautological-unsigned-enum-zero-compare]
  733 |                            ((event->paxis.axis >= 0) && (event->paxis.axis < SDL_arraysize(pen_axisnames))) ? pen_axisnames[event->paxis.axis] : "[UNKNOWN]", event->paxis.value);
      |                              ~~~~~~~~~~~~~~~~~ ^  ~
@icculus icculus self-assigned this Nov 4, 2024
@icculus icculus added this to the 3.2.0 milestone Nov 4, 2024
@sezero
Copy link
Contributor

sezero commented Nov 4, 2024

I hate that about clang. Is it impossible to receive an arbitrary integer instead of the defined enumerated values in C?

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

No branches or pull requests

3 participants