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

Consistently handle child prefix/index as unsigned char, funsigned-char #251

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

evelikov
Copy link
Collaborator

As a follow-up to #247 it addresses all the s/int/unsigned char/ instances that I could find.

It also forces char to unsigned char, since that's the majority(?) of our use case.

NOTE: the PR is completely untested, hence marked as draft

Once the linked PR has landed and we have agreement if -funsigned-char is something we'd really want, I will grab a few old and new kernels and do some testing.

Stop implicitly casting the child prefix/index to int. It can have high
bits set thus get promoted to wildly incorrect value and cause chaos
further on.

Signed-off-by: Emil Velikov <[email protected]>
Stop implicitly casting the child prefix/index to int. It can have high
bits set thus get promoted to wildly incorrect value and cause chaos
further on.

Signed-off-by: Emil Velikov <[email protected]>
Handful of places throughout the codebase rely on the data to be
unsigned char. While most of those should be addressed now, one could
argue that we should be switching the default and resolve the whole
class of issues, instead of playing whack-a-mole by fixing individual
bugs.

Signed-off-by: Emil Velikov <[email protected]>
@evelikov evelikov marked this pull request as draft November 16, 2024 15:39
Copy link

codecov bot commented Nov 16, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
libkmod/libkmod-index.c 33.33% 6 Missing ⚠️
Files with missing lines Coverage Δ
tools/depmod.c 57.30% <100.00%> (ø)
libkmod/libkmod-index.c 50.94% <33.33%> (ø)

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.

1 participant