[coreboot-gerrit] Change in ...coreboot[master]: [RFC] arch/riscv/stdint.h: Check the size of (u)intptr_t

Jonathan Neuschäfer (Code Review) gerrit at coreboot.org
Tue Dec 11 16:49:16 CET 2018


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 at 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"

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/30168
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5583ba58eeca3a37229b41b6517adfc12b2fddce
Gerrit-Change-Number: 30168
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181211/7d584c90/attachment.html>


More information about the coreboot-gerrit mailing list