summaryrefslogtreecommitdiff
path: root/ls-files.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-01-07 09:33:54 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-01-07 18:51:06 (GMT)
commit8f1d2e6f49ee51ac062ab38337a6a70dd1998def (patch)
tree0054fb58243a1ede631e0d12a0482d37c3476a25 /ls-files.c
parent3be7098ce444395959c856de1eb9312550193aac (diff)
downloadgit-8f1d2e6f49ee51ac062ab38337a6a70dd1998def.zip
git-8f1d2e6f49ee51ac062ab38337a6a70dd1998def.tar.gz
git-8f1d2e6f49ee51ac062ab38337a6a70dd1998def.tar.bz2
[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 <junkio@cox.net>
Diffstat (limited to 'ls-files.c')
-rw-r--r--ls-files.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ls-files.c b/ls-files.c
index cd87430..74ec8c0 100644
--- a/ls-files.c
+++ b/ls-files.c
@@ -208,7 +208,7 @@ static int excluded(const char *pathname)
struct nond_on_fs {
int len;
- char name[0];
+ char name[FLEX_ARRAY]; /* more */
};
static struct nond_on_fs **dir;