Skip to content

Commit aa81cb9

Browse files
GustavoARSilvaKAGA-KOKO
authored andcommitted
x86/fpu: Replace zero-length array in struct xregs_state with flexible-array member
Zero-length arrays are deprecated [1] and have to be replaced by C99 flexible-array members. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help to make progress towards globally enabling -fstrict-flex-arrays=3 [2] Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Kees Cook <[email protected]> Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays [1] Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2] Link: KSPP#78 Link: https://lore.kernel.org/r/Y7zCFpa2XNs/o9YQ@work
1 parent 5dc4c99 commit aa81cb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/include/asm/fpu/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ struct xstate_header {
321321
struct xregs_state {
322322
struct fxregs_state i387;
323323
struct xstate_header header;
324-
u8 extended_state_area[0];
324+
u8 extended_state_area[];
325325
} __attribute__ ((packed, aligned (64)));
326326

327327
/*

0 commit comments

Comments
 (0)