C
CBFalconer
Chris said:Thinking about it, it's quite possible for a compiler to use two
different calling conventions automatically. If it's a variadic
function, or (in C90) has a null prototype (), the calling code
pops the parameters, otherwise the called function pops them. If
a function has a fixed number of parameters (as anything using
_stdcall must do) this this is not a problem.
If there isn't a prototype in scope at the time of the function call,
assume whichever you like and issue a warning, it's te programmer's
problem...
As another ferexample, you can have a macro in stdio.h that reads:
#define printf _funnycall _xprintf
with whatever implementations specific action you wish from
_funnycall. _xprintf will be written to do the actual work. With
C99 variadic macros you can carry this further by including the
parameters to printf in xprintf.