aboutsummaryrefslogtreecommitdiff
path: root/misc
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 /misc
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 'misc')
-rw-r--r--misc/sys/mman.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/misc/sys/mman.h b/misc/sys/mman.h
index c68a85d..ae8cee3 100644
--- a/misc/sys/mman.h
+++ b/misc/sys/mman.h
@@ -100,10 +100,12 @@ extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW;
/* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to
be memory resident. */
-extern int mlock (const void *__addr, size_t __len) __THROW;
+extern int mlock (const void *__addr, size_t __len) __THROW
+ __attr_access ((__none__, 1));
/* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */
-extern int munlock (const void *__addr, size_t __len) __THROW;
+extern int munlock (const void *__addr, size_t __len) __THROW
+ __attr_access ((__none__, 1));
/* Cause all currently mapped pages of the process to be memory resident
until unlocked by a call to the `munlockall', until the process exits,