+2016-11-14 Paul Eggert <eggert@union>
+
+ obstack: port to gcc -fcheck-pointer-bounds
+ Problem found by 'make check' failure on bleeding-edge coreutils
+ on an MPX-enabled CPU (Intel Core i3-7100U) running GCC (Ubuntu
+ 6.2.0-5ubuntu12), configured via "./configure
+ --enable-gcc-warnings CFLAGS='-mmpx -fcheck-pointer-bounds -g3
+ -O2' LDFLAGS='-static-libmpx -static-libmpxwrappers'".
+ * lib/obstack.h (__FLEXIBLE_ARRAY_MEMBER):
+ New macro, copied from fts_.h.
+ (struct _obstack_chunk.contents): Use it.
+
2016-11-14 Eric Blake <eblake@redhat.com>
strerror_r-posix: Another fix, for HAVE_DECL_STRERROR_R on mingw.
#include <stddef.h> /* For size_t and ptrdiff_t. */
#include <string.h> /* For __GNU_LIBRARY__, and memcpy. */
+#if __STDC_VERSION__ < 199901L
+# define __FLEXIBLE_ARRAY_MEMBER 1
+#else
+# define __FLEXIBLE_ARRAY_MEMBER
+#endif
+
#if _OBSTACK_INTERFACE_VERSION == 1
/* For binary compatibility with obstack version 1, which used "int"
and "long" for these two types. */
{
char *limit; /* 1 past end of this chunk */
struct _obstack_chunk *prev; /* address of prior chunk or NULL */
- char contents[4]; /* objects begin here */
+ char contents[__FLEXIBLE_ARRAY_MEMBER]; /* objects begin here */
};
struct obstack /* control current object in current chunk */