https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118194
--- Comment #4 from Sam James <sjames at gcc dot gnu.org> --- (In reply to Xi Ruoyao from comment #1) > I suppose Glibc should add __attribute__((access(1, none))) for mlock. commit 013106ae677af9836614ace1a01d25b63fa555a7 (HEAD -> master, origin/master, origin/HEAD) Author: Xi Ruoyao <xry...@xry111.site> Date: Thu Dec 26 12:51:18 2024 +0800 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 <xry...@xry111.site> Reviewed-by: Sam James <s...@gentoo.org>