Message ID | 20230621213444.2017-3-cristian@rodriguez.im |
---|---|
State | New |
Headers | show |
Series | None | expand |
* Cristian Rodríguez via Libc-alpha: > The linux kernel has always required a compiler supporting c99 > flexible-arrays. This is not an installed header, so this commit message is misleading. Why __attribute_nonstring__? Thanks, Florian
On Thu, Jun 22, 2023 at 1:25 AM Florian Weimer <fweimer@redhat.com> wrote: > * Cristian Rodríguez via Libc-alpha: > > > The linux kernel has always required a compiler supporting c99 > > flexible-arrays. > > This is not an installed header, so this commit message is misleading. > Why __attribute_nonstring__? > > > So there is a warning if someone, by a mistake obviously.,,treats it as an string or calls any str* function on it.. data is filled with struct linux_dirent s
diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h index 3cb313b410..20ce7d1347 100644 --- a/sysdeps/unix/sysv/linux/dirstream.h +++ b/sysdeps/unix/sysv/linux/dirstream.h @@ -47,7 +47,7 @@ struct __dirstream sufficient because dirents on 32-bit platforms can require 64-bit alignment. We use "long double" here to be consistent with what malloc uses. */ - char data[0] __attribute__ ((aligned (__alignof__ (long double)))); + char data[] __attribute_nonstring__ __attribute__ ((aligned (__alignof__ (long double)))); }; #define _DIR_dirfd(dirp) ((dirp)->fd)
The linux kernel has always required a compiler supporting c99 flexible-arrays. Signed-off-by: Cristian Rodríguez <cristian@rodriguez.im> --- sysdeps/unix/sysv/linux/dirstream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)