Difference between returning result and assigning result through pointer
argument?
I am developing a naive programming language, effectively a C code
generator, and for simplification, I want to represent all functions as
with no return type in C, with the return type being passed as the first
parameter, if any.
My question is whether this could present a compatibility or performance
issue, I am not really sure what exactly is the difference, but common
logic suggests that there is not much of a difference from the function
assigning the returned value to the return address vs doing that manually
and the address is a parameter. But maybe there is some additional work
being done? Maybe different optimizations kick in?
No comments:
Post a Comment