From: Johannes Schindelin Date: Fri, 4 Oct 2019 15:09:27 +0000 (-0700) Subject: winansi: use FLEX_ARRAY to avoid compiler warning X-Git-Tag: v2.24.0-rc0~26^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41616ef6182271178c63e1caf0d21f12bea2d41e;p=thirdparty%2Fgit.git winansi: use FLEX_ARRAY to avoid compiler warning MSVC would complain thusly: C4200: nonstandard extension used: zero-sized array in struct/union Let's just use the `FLEX_ARRAY` constant that we introduced for exactly this type of scenario. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/compat/winansi.c b/compat/winansi.c index cacd82c833..54fd701cbf 100644 --- a/compat/winansi.c +++ b/compat/winansi.c @@ -546,7 +546,7 @@ static HANDLE swap_osfhnd(int fd, HANDLE new_handle) typedef struct _OBJECT_NAME_INFORMATION { UNICODE_STRING Name; - WCHAR NameBuffer[0]; + WCHAR NameBuffer[FLEX_ARRAY]; } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION; #define ObjectNameInformation 1