]> git.codecow.com Git - Monocypher.git/commit
Fixed local variable shadowing
authorLoup Vaillant <loup@loup-vaillant.fr>
Fri, 4 Jun 2021 21:51:20 +0000 (23:51 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Fri, 4 Jun 2021 21:51:20 +0000 (23:51 +0200)
commit8c5bcacdecafd23928a048728a10c5f414d40ea2
tree619965ff05a895cdaadbefce13b7e9069b1422c8
parent89434d01b3aa925b7cd69e13cf2bf58e1b542bc2
Fixed local variable shadowing

In crypto_x25519_inverse(), line 2949 and 2953, we use the ZERO macro in
a context where the enclosing scope already defines the varible `i`.

Turns out ZERO defines `i` for internal use in an enclosed scope. This
trigger a warning in some compilers about variable shadowing: declaring
a local variable with the same name as an enclosing local variable. This
warning is especially annoying when combined with -Werror.

To prevent this, the macros COPY and ZERO have been modified so they use
a variable name that is unlikely to be used anywhere else (`i__`).
src/monocypher.c