Avoid undefined behaviour with signed integer multiplication#1296
Merged
mr-c merged 3 commits intosimd-everywhere:masterfrom Jun 30, 2025
Merged
Avoid undefined behaviour with signed integer multiplication#1296mr-c merged 3 commits intosimd-everywhere:masterfrom
mr-c merged 3 commits intosimd-everywhere:masterfrom
Conversation
mr-c
requested changes
Jun 25, 2025
Contributor
related:
|
mr-c
reviewed
Jun 26, 2025
3abee75 to
b21f29e
Compare
Contributor
Author
|
It looks like this is now failing when compiled as C++: What is the recommended way of keeping the code compatible with both C and C++? I'm not very good with C++. |
Collaborator
My mistake, sorry Try one of Lines 842 to 858 in 51743e7 |
mr-c
approved these changes
Jun 30, 2025
Fixes: ``` error: implicit conversion changes signedness: 'uint32_t' (aka 'unsigned int') to 'int32_t' (aka 'int') [-Werror,-Wsign-conversion] ``` Co-authored-by: Michael R. Crusoe <1330696+mr-c@users.noreply.github.com>
6611e2c to
d0b0b5f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the minimal patch that makes tests pass with clang 20.1.x on Fedora rawhide x86_64 and aarch64.
Fixes #1295 .