Page MenuHomeFreeBSD

D52820.id163446.diff
No OneTemporary

D52820.id163446.diff

diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7
--- a/share/man/man7/arch.7
+++ b/share/man/man7/arch.7
@@ -340,13 +340,33 @@
.Ed
.Pp
Common type size and endianness macros:
-.Bl -column -offset indent "BYTE_ORDER" "Meaning"
+.Bl -column -offset indent "__SIZEOF_POINTER__" "Meaning"
.It Sy Macro Ta Sy Meaning
+.It Dv __SIZEOF_LONG__ Ta size in bytes of long
+.It Dv __SIZEOF_POINTER__ Ta size in bytes of intptr_t and pointer
+.It Dv __SIZEOF_SIZE_T__ Ta size in bytes of size_t
.It Dv __LP64__ Ta 64-bit (8-byte) long and pointer, 32-bit (4-byte) int
.It Dv __ILP32__ Ta 32-bit (4-byte) int, long and pointer
.It Dv BYTE_ORDER Ta Either Dv BIG_ENDIAN or Dv LITTLE_ENDIAN .
.El
.Pp
+Because systems were historically either
+.Dv __ILP32__
+or
+.Dv __LP64__
+it has been common for programmers to test of one and assume the other
+one in an else branch.
+With the arrival of CHERI architectures, this is no longer the case and
+.Dv __SIZEOF_*__
+macros should be used for machine independent code and care should be
+taken when introducing new uses of
+.Dv __ILP32__
+or
+.Dv __LP64__ .
+Compilers for CHERI targets do not define
+.Dv __LP64__
+as their pointers are 128-bit capabilities.
+.Pp
Architecture-specific macros:
.Bl -column -offset indent "Architecture" "Predefined macros"
.It Sy Architecture Ta Sy Predefined macros

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 13, 11:10 PM (8 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23308373
Default Alt Text
D52820.id163446.diff (1 KB)

Event Timeline