aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2024-12-26 12:51:18 +0800
committerAndreas K. Hüttel <dilfridge@gentoo.org>2025-01-01 16:08:36 +0100
commit013106ae677af9836614ace1a01d25b63fa555a7 (patch)
tree7fae500dffb55324e8251978cccaa3d5a961a825 /sysdeps/unix
parent58272284b633e5fd17293abdc55d56e546a1b02a (diff)
downloadglibc-013106ae677af9836614ace1a01d25b63fa555a7.zip
glibc-013106ae677af9836614ace1a01d25b63fa555a7.tar.gz
glibc-013106ae677af9836614ace1a01d25b63fa555a7.tar.bz2
mlock, mlock2, munlock: Tell the compiler we don't dereference the pointer
Since https://gcc.gnu.org/r11-959, the compiler emits -Wmaybe-uninitialized if a const pointer to an uninitialized buffer is passed. Tell the compiler we don't dereference the pointer to remove the false alarm. Link: https://gcc.gnu.org/PR118194 Signed-off-by: Xi Ruoyao <xry111@xry111.site> Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/bits/mman-shared.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/bits/mman-shared.h b/sysdeps/unix/sysv/linux/bits/mman-shared.h
index 7a98742..d601bd0 100644
--- a/sysdeps/unix/sysv/linux/bits/mman-shared.h
+++ b/sysdeps/unix/sysv/linux/bits/mman-shared.h
@@ -56,7 +56,8 @@ int memfd_create (const char *__name, unsigned int __flags) __THROW;
/* Lock pages from ADDR (inclusive) to ADDR + LENGTH (exclusive) into
memory. FLAGS is a combination of the MLOCK_* flags above. */
-int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW;
+int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW
+ __attr_access ((__none__, 1));
/* Allocate a new protection key, with the PKEY_DISABLE_* bits
specified in ACCESS_RESTRICTIONS. The protection key mask for the