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

Clang 15 warning in bignum.c in 2.28 #7166

Closed
gilles-peskine-arm opened this issue Feb 24, 2023 · 1 comment
Closed

Clang 15 warning in bignum.c in 2.28 #7166

gilles-peskine-arm opened this issue Feb 24, 2023 · 1 comment
Labels
bug component-crypto Crypto primitives and low-level interfaces size-s Estimated task size: small (~2d)

Comments

@gilles-peskine-arm
Copy link
Contributor

In mbedtls-2.28 as of 50bc975 (and since way before 2.28.0), on x86_64 with the default configuration:

$ make CC=clang-15 CFLAGS=-Werror lib
  CC    aes.c
  CC    aesni.c
  CC    arc4.c
  CC    aria.c
  CC    asn1parse.c
  CC    asn1write.c
  CC    base64.c
  CC    bignum.c
bignum.c:1429:29: error: variable 't' set but not used [-Werror,-Wunused-but-set-variable]
    mbedtls_mpi_uint c = 0, t = 0;
                            ^
1 error generated.
make[1]: *** [Makefile:292: bignum.o] Error 1
make: *** [Makefile:17: lib] Error 2

Earlier versions of Clang don't emit a warning.

This doesn't affect development, where this part of the code has been rewritten and the variable t no longer exists.

@gilles-peskine-arm gilles-peskine-arm added bug component-crypto Crypto primitives and low-level interfaces size-s Estimated task size: small (~2d) labels Feb 24, 2023
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Feb 24, 2023
The assembly code uses t only on some architectures. Fixes Mbed-TLS#7166.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
@gilles-peskine-arm
Copy link
Contributor Author

Fixed by #7167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component-crypto Crypto primitives and low-level interfaces size-s Estimated task size: small (~2d)
Projects
None yet
Development

No branches or pull requests

1 participant