There are (among others) two types of calling conventions - stdcall and cdecl. I have few questions on them:
- When a cdecl function is called, how does a caller know if it should free up the stack ? At the call site, does the caller know if the function being called is a cdecl or a stdcall function ? How does it work ? How does the caller know if it should free up the stack or not ? Or is it the linkers responsibility ?
- If a function which is declared as stdcall calls a function(which has a calling convention as cdecl), or the other way round, would this be inappropriate ?
- In general, can we say that which call will be faster - cdecl or stdcall ?