[PATCH] Check for existence of mempcpy

Mark Wielaard mark@klomp.org
Thu Feb 23 11:40:00 GMT 2017


On Fri, Feb 17, 2017 at 01:16:11PM +0100, Ulf Hermann wrote:
> And then there are nonstandard C constructs, especially void* arithmetics

void * arithmetic can at times be surprising, so that seems a fine cleanup.
Best to make sure the code compiles cleanly with -Wpointer-arith.

> and statement expressions, which I would like to replace with standards
> compliant C. That is a somewhat larger and not yet finished project, and
> I'm hoping you're generally open to it.

Sure, but it depends on the result. Avoiding void * arithmetic seems kind
of worth it because it is sometimes surprising and it makes sure we always
use the correct type for things involving pointer arithmetic. Which probably
cleans up the code. But statement expressions are really useful to define
safe macros without having to turn everything into a nested or inlined
function. So I am not sure such a specific change would result in cleaner
code. So I would have to see the result first. Alternatively we could also
just extend the configure test that checks the compiler supports proper
GNU99 by adding a statement expression to the testcase (we already expect
support for mixed declarations and code, nested functions and arrays of
variable lengths because those are really useful).

Cheers,

Mark



More information about the Elfutils-devel mailing list