On 09/02/2017 02:11 AM, Paul Eggert wrote:
struct scratch_buffer depends on a GNU C extension:
assignment to an object changes its dynamic type. It is not standard C.
Standard C only allows one way to allocate untyped memory, and that is
malloc.
That should not be a problem, as Gnulib code regularly breaks those
standard-C rules when it comes to memory allocation.
in looking at the current Gnulib glob.c again, my previous email was too
pessimistic. Gnulib glob.c accesses the stack-allocated objects in
question only via char * pointers, and standard C (C11 section 6.5
paragraph 7 last line) has an exception for these accesses that makes
the glob.c code valid. So we should be OK even on theoretical platforms
that insist on strict conformance here.
Here's the Gnulib commit that the above analysis refers to:
http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=5f7d5f2b78d54258e8e2a41596bba0e123c75de4