C99 flexible array member, compile with: either plain gcc, without -ansi -pedantic in $CC or $CFLAGS or a c99 compiler like CC="gcc -std=c99" CPPFLAGS="-D_GNU_SOURCE" --- ldif.c 2009-08-18 23:58:27 +++ ldif.c 2009-09-24 15:31:19 @@ -593,9 +593,9 @@ typedef struct bvlist { char *trunc; /* filename was truncated here */ int inum; /* num from "attr={num}" in filename, or INT_MIN */ char savech; /* original char at *trunc */ - char fname; /* variable length array BVL_NAME(bvl) = &fname */ -# define BVL_NAME(bvl) ((char *) (bvl) + offsetof(bvlist, fname)) -# define BVL_SIZE(namelen) (sizeof(bvlist) + (namelen)) + char fname[]; /* variable length array BVL_NAME(bvl) = fname[] */ +# define BVL_NAME(bvl) ((bvl)->fname) +# define BVL_SIZE(namelen) (sizeof(bvlist) + (namelen) + 1) } bvlist; static int