If using a void function in C versus a function that returns an arbitrary type (say int), will int
function take more CPU cycles than a void
function?
Example:
int a, b = 1, c = 2;
void f()
{
a = b + c;
}
int g()
{
a = b + c;
return a;
}
My common sense tells me that a return is an action, so it should take some of the CPU time, but I don't have proper deep fundamental knowledge that is needed here, nor do I know assembler to answer this question confidently by myself. Googling around was not successful either.
Edit: My interest is purely academic and I don't expect to gain any noticeable (or even close to that) amount of performance by using void versus int functions.