Add parentheses to unsafe macros#716
Conversation
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
| #define PSA_PAKE_INPUT_SIZE(alg, primitive, input_step) \ | ||
| (PSA_ALG_IS_JPAKE(alg) && \ | ||
| primitive == PSA_PAKE_PRIMITIVE(PSA_PAKE_PRIMITIVE_TYPE_ECC, \ | ||
| (PSA_ALG_IS_JPAKE((alg)) && \ |
There was a problem hiding this comment.
Multiple parentheses not required
(PSA_ALG_IS_JPAKE(alg) &&
There was a problem hiding this comment.
Should now be resolved.
| #else /* 64-bit */ | ||
|
|
||
| #define MAX32 N->n * 2 | ||
| #define MAX32 ((N->n) * 2) |
There was a problem hiding this comment.
N->n is not a formal parameter of the macro
(N->n * 2)
There was a problem hiding this comment.
Should now be resolved.
| #else /* 64 bit */ | ||
|
|
||
| #define MAX32 X_limbs * 2 | ||
| #define MAX32 ((X_limbs) * 2) |
There was a problem hiding this comment.
The same as above
(X_limbs * 2)
There was a problem hiding this comment.
Should now be resolved.
| #define PSA_PAKE_OUTPUT_SIZE(alg, primitive, output_step) \ | ||
| (PSA_ALG_IS_JPAKE(alg) && \ | ||
| primitive == PSA_PAKE_PRIMITIVE(PSA_PAKE_PRIMITIVE_TYPE_ECC, \ | ||
| (PSA_ALG_IS_JPAKE((alg)) && \ |
There was a problem hiding this comment.
The same, (PSA_ALG_IS_JPAKE(alg) &&
There was a problem hiding this comment.
Should now be resolved.
|
No bugs, only some extra parentheses. Technically, |
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
|
The code is good now. |
gilles-peskine-arm
left a comment
There was a problem hiding this comment.
LGTM. There are more unhygienic macros but we don't need to fix them all in one go.
Description
Add parentheses to unsafe macros resolves #712
PR checklist