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

Fix error: comparison of unsigned expression < 0 is always false #7455

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

babsingh
Copy link
Contributor

@babsingh babsingh commented Sep 6, 2024

omrthread_prio_t is of type uintptr_t. It cannot have a value below 0.

J9THREAD_PRIORITY_MIN is defined as 0 and J9THREAD_PRIORITY_MAX is
defined as 11.

In omrthread_attr_set_priority, priority, which is of type
omrthread_prio_t, will always be greater than or equal to
J9THREAD_PRIORITY_MIN. To see if priority is invalid, we only need
to evaluate if it is greater than J9THREAD_PRIORITY_MAX.

Fixes: #7454

@babsingh
Copy link
Contributor Author

babsingh commented Sep 6, 2024

jenkins build all

@babsingh
Copy link
Contributor Author

babsingh commented Sep 6, 2024

fyi @pshipton, can you review these changes?

@babsingh
Copy link
Contributor Author

babsingh commented Sep 6, 2024

jenkins build all

omrthread_prio_t is of type uintptr_t. It cannot have a value below 0.

J9THREAD_PRIORITY_MIN is defined as 0 and J9THREAD_PRIORITY_MAX is
defined as 11.

In omrthread_attr_set_priority, priority, which is of type
omrthread_prio_t, will always be greater than or equal to
J9THREAD_PRIORITY_MIN. To see if priority is invalid, we only need
to evaluate if it is greater than J9THREAD_PRIORITY_MAX.

Fixes: eclipse#7454

Signed-off-by: Babneet Singh <[email protected]>
@babsingh
Copy link
Contributor Author

babsingh commented Sep 9, 2024

jenkins build all

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

Successfully merging this pull request may close these issues.

omrthreadattr.c signed comparison of unsigned variable priority
3 participants