git: 4605fd58a353 - stable/13 - LinuxKPI: change DECLARE_FLEX_ARRAY()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Sun, 27 Feb 2022 23:43:34 UTC
The branch stable/13 has been updated by bz:

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

commit 4605fd58a3538bcc0ba4eecc0a53c8d264e25a90
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-27 23:41:54 +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
    Reviewed by:    hselasky
    Differential Revision: https://reviews.freebsd.org/D34350
    
    (cherry picked from commit fab601c5b76a1183c1849222667481fdde948ef9)
---
 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 1e8fef985803..85dc3bf88511 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.