aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc/extend.texi
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2021-12-09 11:24:14 -0700
committerMartin Sebor <msebor@redhat.com>2021-12-09 11:28:43 -0700
commit9eeca99ccce4b56765920bd3c839abb77bbd4280 (patch)
tree39539227311170d470b6c68e6fbb6ec331248182 /gcc/doc/extend.texi
parenta2c12cb70892d82506b3044c4c34f5667eb12835 (diff)
downloadgcc-9eeca99ccce4b56765920bd3c839abb77bbd4280.zip
gcc-9eeca99ccce4b56765920bd3c839abb77bbd4280.tar.gz
gcc-9eeca99ccce4b56765920bd3c839abb77bbd4280.tar.bz2
Avoid expecting nonzero size for access none void* arguments [PR101751].
Resolves: PR middle-end/101751 - attribute access none with void pointer expects nonzero size gcc/ChangeLog: PR middle-end/101751 * doc/extend.texi (attribute access): Adjust. * gimple-ssa-warn-access.cc (pass_waccess::maybe_check_access_sizes): Treat access mode none on a void* argument as expecting as few as zero bytes. gcc/testsuite/ChangeLog: PR middle-end/101751 * gcc.dg/Wstringop-overflow-86.c: New test.
Diffstat (limited to 'gcc/doc/extend.texi')
-rw-r--r--gcc/doc/extend.texi5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index ef654d7..266ef76 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2524,7 +2524,6 @@ The following attributes are supported on most targets.
@table @code
@c Keep this table alphabetized by attribute name. Treat _ as space.
-@item access
@itemx access (@var{access-mode}, @var{ref-index})
@itemx access (@var{access-mode}, @var{ref-index}, @var{size-index})
@@ -2598,7 +2597,9 @@ __attribute__ ((access (write_only, 1, 2), access (read_write, 3))) int fgets (c
The access mode @code{none} specifies that the pointer to which it applies
is not used to access the referenced object at all. Unless the pointer is
null the pointed-to object must exist and have at least the size as denoted
-by the @var{size-index} argument. The object need not be initialized.
+by the @var{size-index} argument. When the optional @var{size-index}
+argument is omitted for an argument of @code{void*} type the actual pointer
+agument is ignored. The referenced object need not be initialized.
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}.