Is using an uninitialized variable as the src for memcpy undefined behaviour in C?
void foo(int *to)
{
int from;
memcpy(to, &am
( Earlier -Didn't notice address of from is passed) . No , that won't cause undefined behaviour , just that from has indeterminate value. As far as you don't intend to use the value of uninitialized variable , program will have a well defined behaviour.
(As allocating space and not initializing variables is not UB .)