From: Nick Bowler Date: Sun, 26 Sep 2021 06:06:47 +0000 (-0400) Subject: Use gnulib flexmember module. X-Git-Url: http://git.draconx.ca/gitweb/liblbx.git/commitdiff_plain/bd5f6b55320b6889827908762197642b484ea28d Use gnulib flexmember module. For increased portability to older C compilers. --- diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 3626ead..7fd3466 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -39,12 +39,14 @@ # --libtool \ # --macro-prefix=gl \ # --no-vc-files \ +# flexmember \ # fnmatch \ # getopt-gnu # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) gl_MODULES([ + flexmember fnmatch getopt-gnu ]) diff --git a/src/image.c b/src/image.c index 24dce99..ed80565 100644 --- a/src/image.c +++ b/src/image.c @@ -62,7 +62,7 @@ struct lbx_image_priv { unsigned currentx, currenty, currentn; int read_state; - unsigned long offsets[]; + unsigned long offsets[FLEXIBLE_ARRAY_MEMBER]; }; static struct lbx_image_priv *lbx_img_init(unsigned char *hdr) diff --git a/src/lbx.c b/src/lbx.c index 17c68b1..8080b67 100644 --- a/src/lbx.c +++ b/src/lbx.c @@ -42,7 +42,7 @@ struct lbx_priv { struct lbx_file_state *last_file; - unsigned long offsets[]; + unsigned long offsets[FLEXIBLE_ARRAY_MEMBER]; }; struct lbx_file_state {