Post by Paul EggertPost by Tim Rühsenglob.c:618:64: warning: pointer of type 'void *' used in arithmetic
[-Wpointer-arith]
err = getpwnam_r (s.data, &pwbuf, s.data + ssize,
With Best Regards, Tim
Thanks, I tweaked it slightly to avoid inserting a cast (as it's better
to avoid casts when it's easy), and installed the attached patch into
Gnulib, in your name.
... and I've added the ChangeLog entry for it.
But, when we look at the definition
struct scratch_buffer {
void *data; /* Pointer to the beginning of the scratch area. */
size_t length; /* Allocated space at the data pointer, in bytes. */
...
};
it seems quite natural to do pointer arithmetic on 'data'. Namely, this will
happen each time a scratch_buffer gets booked by several (not just one)
pieces of memory.
Therefore I would suggest to change the type of the 'data' field to 'char *'
in gnulib. I know that in glibc this is not needed, because glibc assumes GCC
and GCC supports 'void *' arithmetic as an extension.
Rationale: 'scratch_buffer' is a module of its own right in gnulib, and
may get more uses, in order to avoid stack overflows.
Bruno