char* p = init();
p = foo(p); /* this one */
the function foo
prototype:
char* foo(char* p);
Is it permissible to call foo
that way, or does it fall in the Undefined Behavior category?
Yes, this is well-defined - there is a sequence point between the evaluation of the function arguments and the function call.