diff options
author | Xi Ruoyao <xry111@xry111.site> | 2024-12-26 12:51:18 +0800 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2025-01-01 16:08:36 +0100 |
commit | 013106ae677af9836614ace1a01d25b63fa555a7 (patch) | |
tree | 7fae500dffb55324e8251978cccaa3d5a961a825 /misc | |
parent | 58272284b633e5fd17293abdc55d56e546a1b02a (diff) | |
download | glibc-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.h | 6 |
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, |