ipc:msg: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper
PATCH 1/1 ipc:msg: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper
Replacing zero-length arrays with C99 flexible-array members because they are deprecated.
Use the new DECLARE_FLEX_ARRAY() auxiliary macro instead of defining a zero-length array.
This fixes warnings such as:
./ipc/msg.c:981:6-11: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)
Signed-off-by Atul Raut <[email protected]>
--- ipc/msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ipc/msg.c +1 -1
@@ -978,7 +978,7 @@ SYSCALL_DEFINE4(msgsnd, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz,struct compat_msgbuf {compat_long_t mtype; -char mtext[1 ]; + DECLARE_FLEX_ARRAY(char, mtext); }; long compat_ksys_msgsnd(int msqid, compat_uptr_t msgp,
Signature · 1 line
2.34.1