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

Closed
wants to merge 2 commits into 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.

@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 60.00000% with 6 lines in your changes missing coverage. Please review.

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

🚨 Try these New Features:

configure.ac Outdated Show resolved Hide resolved
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.

In addition, convert the existing `unsigned char` instances to uint8_t,
which better illustrates what we're after - a fixed sized 8 bit unsigned
integer.

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.

In addition, convert the existing `unsigned char` instances to uint8_t,
which better illustrates what we're after - a fixed sized 8 bit unsigned
integer.

Signed-off-by: Emil Velikov <[email protected]>
@evelikov evelikov marked this pull request as ready for review November 21, 2024 10:39
lucasdemarchi pushed a commit that referenced this pull request Nov 22, 2024
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.

In addition, convert the existing `unsigned char` instances to uint8_t,
which better illustrates what we're after - a fixed sized 8 bit unsigned
integer.

Signed-off-by: Emil Velikov <[email protected]>
Link: #251
Signed-off-by: Lucas De Marchi <[email protected]>
lucasdemarchi pushed a commit that referenced this pull request Nov 22, 2024
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.

In addition, convert the existing `unsigned char` instances to uint8_t,
which better illustrates what we're after - a fixed sized 8 bit unsigned
integer.

Signed-off-by: Emil Velikov <[email protected]>
Link: #251
Signed-off-by: Lucas De Marchi <[email protected]>
@lucasdemarchi
Copy link
Contributor

Applied, 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