[3/6] inet: annotate tu_data and tu_stuff with __decl_is_flex_array

Message ID 20230710150454.5490-4-cristian@rodriguez.im
State New
Headers
Series Support use of -fstrict-flex-arrays in user code |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed

Commit Message

Cristian Rodríguez July 10, 2023, 3:04 p.m. UTC
  Signed-off-by: Cristian Rodríguez <cristian@rodriguez.im>
---
 inet/arpa/tftp.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/inet/arpa/tftp.h b/inet/arpa/tftp.h
index 86e0b6e814..43d1c30fe2 100644
--- a/inet/arpa/tftp.h
+++ b/inet/arpa/tftp.h
@@ -32,6 +32,8 @@ 
 #ifndef _ARPA_TFTP_H
 #define	_ARPA_TFTP_H 1
 
+#include <features.h>
+
 /*
  * Trivial File Transfer Protocol (IEN-133)
  */
@@ -55,9 +57,9 @@  struct	tftphdr {
 				unsigned short	tu_block;	/* block # */
 				short	tu_code;		/* error code */
 			} __attribute__ ((__packed__)) th_u3;
-			char tu_data[0];	/* data or error string */
+			char tu_data[0] __decl_is_flex_array;	/* data or error string */
 		} __attribute__ ((__packed__)) th_u2;
-		char	tu_stuff[0];		/* request packet stuff */
+		char	tu_stuff[0] __decl_is_flex_array;	/* request packet stuff */
 	} __attribute__ ((__packed__)) th_u1;
 } __attribute__ ((__packed__));