I have a function in a program called with this assembly:
push xxx
push xxx
call xxx
add esp, xxx
From what I know this function has the cdecl calling convention.
In GCC I use __attribute__((cdecl)) to make another function act the same as the above function.
But when I debugged it this assembly was shown:
push xxx
push xxx
call xxx
there is no add esp, xxx!
What calling convention should I use in order to produce the same assembly?
I doubt this has anything to do with calling conventions, and is more likely to do with a compiler optimization like “defer-pop” (where the compiler will wait to pop the stack until later on)