]> git.ipfire.org Git - thirdparty/git.git/commitdiff
winansi: use FLEX_ARRAY to avoid compiler warning
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 4 Oct 2019 15:09:27 +0000 (08:09 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 6 Oct 2019 00:07:44 +0000 (09:07 +0900)
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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/winansi.c

index cacd82c833a615a9daebbadca36d08647111a677..54fd701cbfb44907b93e6b331bfb91ca80a87a94 100644 (file)
@@ -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