From 8f1d2e6f49ee51ac062ab38337a6a70dd1998def Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 7 Jan 2006 01:33:54 -0800 Subject: [PATCH] Compilation: zero-length array declaration. ISO C99 (and GCC 3.x or later) lets you write a flexible array at the end of a structure, like this: struct frotz { int xyzzy; char nitfol[]; /* more */ }; GCC 2.95 and 2.96 let you to do this with "char nitfol[0]"; unfortunately this is not allowed by ISO C90. This declares such construct like this: struct frotz { int xyzzy; char nitfol[FLEX_ARRAY]; /* more */ }; and git-compat-util.h defines FLEX_ARRAY to 0 for gcc 2.95 and empty for others. If you are using a C90 C compiler, you should be able to override this with CFLAGS=-DFLEX_ARRAY=1 from the command line of "make". Signed-off-by: Junio C Hamano --- tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tree.c') diff --git a/tree.c b/tree.c index e7a7b7190c..dc1c41e938 100644 --- a/tree.c +++ b/tree.c @@ -1,8 +1,8 @@ +#include "cache.h" #include "tree.h" #include "blob.h" #include "commit.h" #include "tag.h" -#include "cache.h" #include const char *tree_type = "tree"; -- cgit v1.2.3