Someone is going to bite my head off for this one:
I get a hard error from nvcc:
“./xxx_kernel.cu”, line 417: error: a value of type “void *” cannot be
assigned to an entity of type “uint *”
array = malloc((1 + blockDim.x) * sizeof(uint));
Now I think it should autocast void with exactly the same rules used for parameter passing. I don’t have a copy of the ANSI spec on my desk, but I am sure it should work this way. At the very least it should be just a warning, not a hard error (gcc still does not get it right if there are const/volatile qualifiers buried in the type indirections).
IMHO any cast in a C program needs a paragraph written in the comments justifying its use.
yes malloc() was called from a test wrapper in emu mode