From 993803e02d75012efe04ca22cb2d1afefdf34fdc Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Mon, 23 Sep 2019 17:16:58 +0200 Subject: [PATCH] Ignore pointless clang-tidy warning. (#237) * Ignore pointless clang-tidy warning. It wants you to write type suffixes for integers using uppercase. Let's just disable this warning. https://clang.llvm.org/extra/clang-tidy/checks/readability-uppercase-literal-suffix.html * Clean up bugprone-narrowing-conversion --- .clang-tidy | 2 +- crypto_sign/falcon-1024/clean/sign.c | 2 +- crypto_sign/falcon-512/clean/sign.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index d141fd9f..5189c670 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: '*,-llvm-header-guard,-hicpp-*,-readability-function-size,-google-readability-todo,-readability-magic-numbers,-cppcoreguidelines-avoid-magic-numbers,-readability-isolate-declaration' +Checks: '*,-llvm-header-guard,-hicpp-*,-readability-function-size,-google-readability-todo,-readability-magic-numbers,-cppcoreguidelines-avoid-magic-numbers,-readability-isolate-declaration,-readability-uppercase-literal-suffix' WarningsAsErrors: '*' HeaderFilterRegex: '.*' AnalyzeTemporaryDtors: false diff --git a/crypto_sign/falcon-1024/clean/sign.c b/crypto_sign/falcon-1024/clean/sign.c index 9307206e..937d6163 100644 --- a/crypto_sign/falcon-1024/clean/sign.c +++ b/crypto_sign/falcon-1024/clean/sign.c @@ -953,7 +953,7 @@ sampler(void *ctx, fpr mu, fpr isigma) { * centered on 0. */ z0 = gaussian0_sampler(&spc->p); - b = prng_get_u8(&spc->p) & 1; + b = (int)prng_get_u8(&spc->p) & 1; z = b + ((b << 1) - 1) * z0; /* diff --git a/crypto_sign/falcon-512/clean/sign.c b/crypto_sign/falcon-512/clean/sign.c index 9fd0fc78..2b84aea5 100644 --- a/crypto_sign/falcon-512/clean/sign.c +++ b/crypto_sign/falcon-512/clean/sign.c @@ -953,7 +953,7 @@ sampler(void *ctx, fpr mu, fpr isigma) { * centered on 0. */ z0 = gaussian0_sampler(&spc->p); - b = prng_get_u8(&spc->p) & 1; + b = (int)prng_get_u8(&spc->p) & 1; z = b + ((b << 1) - 1) * z0; /*