ClangSharp
ClangSharp copied to clipboard
Error: arithmetic on a pointer to void
Void pointer artihmetic throws an error:
void *cpy(void *dest, const void *src, size_t n);
static bool exec(void *buf, size_t size, void *info, size_t size2) {
memcpy(buf + size * size2++, info, size);
return true;
}
ClangSharpPInvokeGenerator:
Diagnostics for '.\test.h':
.\test.h:12:25: error: arithmetic on a pointer to void
This should hopefully be a fairly trivial fix.
Just another scenario where C/C++ allow an implicit conversion that C# does not and so the explicit casts need to be inserted instead.