https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118194
vvinayag at arm dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vvinayag at arm dot com --- Comment #5 from vvinayag at arm dot com --- (In reply to Sam James from comment #4) > (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> After this commit, there is a build failure : ../sysdeps/unix/sysv/linux/bits/mman-shared.h:60:5: error: attribute ‘access’ invalid mode ‘__none__’; expected one of ‘read_only’, ‘read_write’, or ‘write_only’ 60 | __attr_access ((__none__, 1)); | ^~~~~~~~~~~~~ In file included from ../include/sys/mman.h:2, from ../sysdeps/generic/ldsodefs.h:34, from ../sysdeps/aarch64/ldsodefs.h:47, from ../sysdeps/gnu/ldsodefs.h:46, from ../sysdeps/unix/sysv/linux/ldsodefs.h:25, from <stdin>:2: ../misc/sys/mman.h:104:5: error: attribute ‘access’ invalid mode ‘__none__’; expected one of ‘read_only’, ‘read_write’, or ‘write_only’ 104 | __attr_access ((__none__, 1)); | ^~~~~~~~~~~~~ ../misc/sys/mman.h:108:5: error: attribute ‘access’ invalid mode ‘__none__’; expected one of ‘read_only’, ‘read_write’, or ‘write_only’ 108 | __attr_access ((__none__, 1)); | ^~~~~~~~~~~~~ I am trying to build for aarch64-none-linux-gnu target on an aarch64-none-linux-gnu machine. The gcc version on the build machine is 7.5.0.