https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113922
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur __fortified_attr_access (__write_only__, 2, 3); ... /* For _FORTIFY_SOURCE == 3 we use __builtin_dynamic_object_size, which may use the access attribute to get object sizes from function definition arguments, so we can't use them on functions we fortify. Drop the object size hints for such functions. */ # if __USE_FORTIFY_LEVEL == 3 # define __fortified_attr_access(a, o, s) __attribute__ ((__access__ (a, o))) # else # define __fortified_attr_access(a, o, s) __attr_access ((a, o, s)) # endif Yes that is broken. Let me file the glibc issue.