Jonathan Neuschäfer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30168
Change subject: [RFC] arch/riscv/stdint.h: Check the size of (u)intptr_t ......................................................................
[RFC] arch/riscv/stdint.h: Check the size of (u)intptr_t
TODO: Since (u)intptr_t and these invariants are not architecture specific, the assertions should probably be moved to a central place, but where?
Change-Id: I5583ba58eeca3a37229b41b6517adfc12b2fddce Signed-off-by: Jonathan Neuschäfer j.neuschaefer@gmx.net --- M src/arch/riscv/include/stdint.h 1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/30168/1
diff --git a/src/arch/riscv/include/stdint.h b/src/arch/riscv/include/stdint.h index 76f0d1b..0062a8e 100644 --- a/src/arch/riscv/include/stdint.h +++ b/src/arch/riscv/include/stdint.h @@ -72,6 +72,8 @@ /* Types for `void *' pointers. */ typedef long intptr_t; typedef unsigned long uintptr_t; +_Static_assert(sizeof(intptr_t) == sizeof(void *), "Size of intptr_t is wrong"); +_Static_assert(sizeof(uintptr_t) == sizeof(void *), "Size of uintptr_t is wrong");
/* FIXME: This is used in some print code and may be removed in the future. */ #define PRIu64 "llu"