[PATCH 3/5] linux: Replace zero-length array with flexible-array member on inotify struct

Cristian Rodríguez cristian@rodriguez.im
Wed Jun 21 21:44:41 GMT 2023


This patch only syncs with the current kernel headers.

On Wed, Jun 21, 2023 at 5:35 PM Cristian Rodríguez <cristian@rodriguez.im>
wrote:

> Current kernel versions require a compiler supporting -std=gnu11
> and therefore supporting C99 flexible arrays. old versions require
> a c89 compiler supporting this feature as an extension.
>
> Signed-off-by: Cristian Rodríguez <cristian@rodriguez.im>
> ---
>  sysdeps/unix/sysv/linux/sys/inotify.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/unix/sysv/linux/sys/inotify.h
> b/sysdeps/unix/sysv/linux/sys/inotify.h
> index 1e8e68cd97..535f57e27b 100644
> --- a/sysdeps/unix/sysv/linux/sys/inotify.h
> +++ b/sysdeps/unix/sysv/linux/sys/inotify.h
> @@ -31,7 +31,7 @@ struct inotify_event
>    uint32_t mask;       /* Watch mask.  */
>    uint32_t cookie;     /* Cookie to synchronize two events.  */
>    uint32_t len;                /* Length (including NULs) of name.  */
> -  char name __flexarr; /* Name.  */
> +  char name[];         /* Name.  */
>  };
>
>
> --
> 2.41.0
>
>


More information about the Libc-alpha mailing list