diff options
author | Alexei Fedorov <Alexei.Fedorov@arm.com> | 2020-07-14 12:26:19 +0100 |
---|---|---|
committer | Alexei Fedorov <Alexei.Fedorov@arm.com> | 2020-07-14 15:28:26 +0000 |
commit | 0aa9f3c0f2f2ff675c3c12ae5ac6ceb475d6a16f (patch) | |
tree | 1944f321bb9c06b53132238bf0b22f0aa2ae9d61 | |
parent | 8d5db315d32fd304e4f9ade13d7b62df91c88cb1 (diff) | |
download | platform_external_arm-trusted-firmware-0aa9f3c0f2f2ff675c3c12ae5ac6ceb475d6a16f.tar.gz platform_external_arm-trusted-firmware-0aa9f3c0f2f2ff675c3c12ae5ac6ceb475d6a16f.tar.bz2 platform_external_arm-trusted-firmware-0aa9f3c0f2f2ff675c3c12ae5ac6ceb475d6a16f.zip |
TF-A: Redefine true/false definitions
This patch redefines 'true' and 'false' definitions in
'include/lib/libc/stdbool.h' to fix defect reported by
MISRA C-2012 Rule 10.1
"The expression \"0\" of non-boolean essential type is
being interpreted as a boolean value for the operator \"? :\"."
Change-Id: Ie1b16e5826e5427cc272bd753e15d4d283e1ee4c
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
-rw-r--r-- | include/lib/libc/stdbool.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/lib/libc/stdbool.h b/include/lib/libc/stdbool.h index e39aef7d3..b58334cd0 100644 --- a/include/lib/libc/stdbool.h +++ b/include/lib/libc/stdbool.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -9,8 +9,8 @@ #define bool _Bool -#define true 1 -#define false 0 +#define true (0 < 1) +#define false (0 > 1) #define __bool_true_false_are_defined 1 |