Page MenuHomeFreeBSD

D61772.1795210330.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D61772.1795210330.diff

diff --git a/share/man/man9/cdefs.9 b/share/man/man9/cdefs.9
--- a/share/man/man9/cdefs.9
+++ b/share/man/man9/cdefs.9
@@ -3,7 +3,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
-.Dd November 11, 2026
+.Dd November 17, 2026
.Dt CDEFS 9
.Os
.Sh NAME
@@ -254,10 +254,72 @@
.Fl fbounds-safety .
Without that flag the annotations expand to nothing and the forge macros to a
plain cast.
+.Sy __bidi_indexable
+and
+.Sy __indexable
+are not defined without the flag, because they change the size of a pointer.
.Bl -column "---------------"
.It Sy Macro Ta Sy Description
+.It Sy __single Ta Pointer to exactly one object.
+Pointer arithmetic on it is an error
+.It Sy __unsafe_indexable Ta Plain C pointer with no bounds checks
+.It Sy __counted_by(n) Ta Pointer to
+.Fa n
+elements.
+.Fa n
+is an expression of constants and other parameters or fields of the same
+structure
+.It Sy __counted_by_or_null(n) Ta As
+.Sy __counted_by ,
+but may also be
+.Dv NULL
+.It Sy __sized_by(n) Ta As
+.Sy __counted_by ,
+with
+.Fa n
+in bytes
+.It Sy __sized_by_or_null(n) Ta As
+.Sy __sized_by ,
+but may also be
+.Dv NULL
+.It Sy __ended_by(end) Ta Pointer bounded by the pointer
+.Fa end ,
+which points one past the last element
.It Sy __null_terminated Ta Pointer to an array that ends at its first zero
element, such as a C string
+.It Sy __bidi_indexable Ta Pointer that carries its lower and upper bounds.
+It is wider than a plain pointer, so use it only for local variables
+.It Sy __indexable Ta As
+.Sy __bidi_indexable ,
+with only an upper bound
+.It Sy __header_bidi_indexable Ta
+.Sy __bidi_indexable
+for
+.Ic static inline
+functions in headers.
+Expands to nothing without the flag
+.It Sy __header_indexable Ta
+.Sy __indexable
+for
+.Ic static inline
+functions in headers.
+Expands to nothing without the flag
+.It Sy __unsafe_forge_single(type,p) Ta Convert
+.Fa p
+to a
+.Sy __single
+pointer of
+.Fa type
+without a check
+.It Sy __unsafe_forge_bidi_indexable(type,p,size) Ta Convert
+.Fa p
+to a
+.Sy __bidi_indexable
+pointer of
+.Fa type
+bounded by
+.Fa size
+bytes, without a check
.It Sy __unsafe_forge_null_terminated(type,p) Ta Convert
.Fa p
to a
@@ -266,6 +328,17 @@
.Fa type
without a check.
The caller guarantees that the terminator is there.
+.It Sy __ptrcheck_abi_assume_single() Ta Make unannotated pointers in the
+declarations that follow
+.Sy __single
+.It Sy __ptrcheck_abi_assume_unsafe_indexable() Ta Make unannotated pointers in
+the declarations that follow
+.Sy __unsafe_indexable
+.It Sy __has_ptrcheck Ta 1 when
+.Sy __bidi_indexable
+and
+.Sy __indexable
+are available, 0 otherwise
.El
.Ss Emulated Keywords
As C evolves, many of the old macros we once used have been incorporated into

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 20, 9:32 PM (20 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41875346
Default Alt Text
D61772.1795210330.diff (2 KB)

Event Timeline