git: fab601c5b76a - main - LinuxKPI: change DECLARE_FLEX_ARRAY()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 24 Feb 2022 19:58:50 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=fab601c5b76a1183c1849222667481fdde948ef9

commit fab601c5b76a1183c1849222667481fdde948ef9
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-02-22 22:48:08 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-02-24 19:57:20 +0000

    LinuxKPI: change DECLARE_FLEX_ARRAY()
    
    DECLARE_FLEX_ARRAY can be used inside a structure.  On FreeBSD due to
    -Wgnu-variable-sized-type-not-at-end this yields an error.  Use [0]
    instead of [] to overcome this.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Reviewed by:    hselasky
    Differential Revision: https://reviews.freebsd.org/D34350
---
 sys/compat/linuxkpi/common/include/linux/kernel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h
index 39520cd271ac..d6916812f02a 100644
--- a/sys/compat/linuxkpi/common/include/linux/kernel.h
+++ b/sys/compat/linuxkpi/common/include/linux/kernel.h
@@ -700,7 +700,7 @@ hex2bin(uint8_t *bindst, const char *hexsrc, size_t binlen)
 }
 
 #define	DECLARE_FLEX_ARRAY(_t, _n)					\
-    struct { struct { } __dummy_ ## _n; _t _n[]; }
+    struct { struct { } __dummy_ ## _n; _t _n[0]; }
 
 /*
  * Checking if an option is defined would be easy if we could do CPP inside CPP.