-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[Bignum] Fix 32 bit unreachable code build failure #7806
[Bignum] Fix 32 bit unreachable code build failure #7806
Conversation
Thanks for fixing this, unfortunately the CI is unhappy. |
Also please add a changelog entry, since this is fixing a reported bug. |
Given the size of ciL is set dependant on MBEDTLS_HAVE_INT32 / MBEDTLS_HAVE_INT64, clang rightfully reports this as unreachable code in 32 bit builds. Fix this by using #define guards instead. Signed-off-by: Paul Elliott <paul.elliott@arm.com>
a23a39c
to
215ed13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a correct change.
Also, I've confirmed that this fixes the build in the default configuration on x86_64 with make lib CC=clang-15 CFLAGS='-Werror -Wall -Wextra -Wunreachable-code'
. Together with #7805, this fixes the build in the default configuration with CC=clang-15 cmake
on 32-bit x86.
Ok for merging this with no changelog entry since this only fixes a compiler warning, not code that was actually wrong, and it doesn't fix all the reported issues in #7787.
a3a0025
into
Mbed-TLS:development
} | ||
#ifdef MBEDTLS_HAVE_INT64 | ||
M[P224_WIDTH_MIN] &= ((mbedtls_mpi_uint)-1) >> (P224_UNUSED_BITS); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it have a space before #endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, so it does, thanks for letting us know.
Weird that our code style checker didn't object to that one.
Description
Given the size of ciL is set dependant on MBEDTLS_HAVE_INT32, clang rightfully reports this as unreachable code. Fix this by using #define guards instead.
Addresses #7787
PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")
provided, ornot requireddone, ornot requiredprovided, ornot required