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

make LogTable always signed char #23

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Conversation

benlorenz
Copy link
Contributor

@benlorenz benlorenz commented Mar 15, 2023

char is signed by default on x86 but unsigned on some ARM platforms and the table needs to contain -1. This leads to errors like this:

src/component_types/base_packed_component.h: In static member function ‘static unsigned int BasePackedComponent::log2(unsigned int)’:
src/component_types/base_packed_component.h:128:10: error: narrowing conversion of ‘-1’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]

This was discovered when building GANAK for julia (Yggdrasil) at JuliaPackaging/Yggdrasil#6393 for the following platforms:

aarch64-apple-darwin aarch64-linux-gnu aarch64-linux-musl armv6l-linux-gnueabihf armv6l-linux-musleabihf armv7l-linux-gnueabihf armv7l-linux-musleabihf i686-linux-gnu i686-linux-musl powerpc64le-linux-gnu x86_64-apple-darwin x86_64-linux-gnu x86_64-linux-musl

Two more minor fixes that were necessary will follow in separate PRs.

cc: @lkastner

char is signed by default on x86 but unsigned on some arm platforms
but the table needs to contain -1 and this leads to errors like this:

src/component_types/base_packed_component.h: In static member function ‘static unsigned int BasePackedComponent::log2(unsigned int)’:
src/component_types/base_packed_component.h:128:10: error: narrowing conversion of ‘-1’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]
@msoos msoos merged commit 1aa12a3 into meelgroup:master Mar 16, 2023
@msoos
Copy link
Collaborator

msoos commented Mar 16, 2023

WOW that's some seriously good catch! Thank you!

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.

3 participants