I followed assemble code, and found that in Gcc code, when pass a structure or class as parameter, say:
void __stdcall Foo(class Bar bar):
1. construct a bar obj on caller stack, using constructor or copy constructor, or something similar;
2. fetch a pointer point to the stack object, using “lea “;
3. push the pointer to callee stack as parameter.
4. recover bar from pointer passed, using bar.xxx ;
My question is: As bar is not a pointer type, why gcc still pass the pointer as parameter (Sounded that this is the standard of ANSI C). I guess that in this way, passing parameters are in the uniform syntax, no matter it is a pointer or object.
Could I change this default parameter passing rule? Sometimes I may like to passing object as object, not the extra pointer.