public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-8007] Document that the 'access' and 'nonnull' attributes are independent
@ 2022-04-05 20:44 David Malcolm
0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2022-04-05 20:44 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:0b5723d74f3a731380f78dc1a02a2376951388cf
commit r12-8007-g0b5723d74f3a731380f78dc1a02a2376951388cf
Author: David Malcolm <dmalcolm@redhat.com>
Date: Tue Apr 5 16:43:16 2022 -0400
Document that the 'access' and 'nonnull' attributes are independent
gcc/ChangeLog:
* doc/extend.texi (Common Function Attributes): Document that
'access' does not imply 'nonnull'.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diff:
---
gcc/doc/extend.texi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 8381eb620ea..e10b10bc1f1 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2652,6 +2652,14 @@ The mode is intended to be used as a means to help validate the expected
object size, for example in functions that call @code{__builtin_object_size}.
@xref{Object Size Checking}.
+Note that the @code{access} attribute merely specifies how an object
+referenced by the pointer argument can be accessed; it does not imply that
+an access @strong{will} happen. Also, the @code{access} attribute does not
+imply the attribute @code{nonnull}; it may be appropriate to add both attributes
+at the declaration of a function that unconditionally manipulates a buffer via
+a pointer argument. See the @code{nonnull} attribute for more information and
+caveats.
+
@item alias ("@var{target}")
@cindex @code{alias} function attribute
The @code{alias} attribute causes the declaration to be emitted as an alias
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-05 20:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 20:44 [gcc r12-8007] Document that the 'access' and 'nonnull' attributes are independent David Malcolm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).