https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101440
Bug ID: 101440 Summary: Documentation bug for __attribute__ ((access)) Product: gcc Version: 10.1.0 URL: https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Common-F unction-Attributes.html Status: UNCONFIRMED Keywords: documentation Severity: normal Priority: P3 Component: d Assignee: ibuclaw at gdcproject dot org Reporter: SztfG at yandex dot ru Target Milestone: --- >From documentation: > Examples of the use of the read_only access mode is the argument to the puts > function, or the second and third arguments to the memcpy function. > __attribute__ ((access (read_only, 1, 2))) void* memcpy (void*, const void*, > size_t); There is no reference to "third argument in memcpy function". Or I don't understand something? Maybe there must be __attribute__ ((access (write_only, 1, 3), access (read_only, 2, 3))) void* memcpy (void* restrict, const void* restrict, size_t); so, if we have void *memcpy(void *dest, const void *src, size_t n); then this function can write "size_t n" bytes to "void *dest" and read "size_t n" bytes from "void *src"