Re: calling convention stdcalll and cdecl call
"Alf P. Steinbach" <alfps@start.no> wrote in message
news:25WdnXEUbI2EwR_VnZ2dnUVZ_sudnZ2d@posted.comnet
* Alex Blekhman:
You'd find decimal number system problematic if you came from an
octal culture, being used to that.
According to my understanding of what a calling convention
consists of, your example is beyond the limits of __stdcall
capabilities because it requires new convention about the meaning
of parameters.
May be. But the point is that stdcall could easily have used this
technique.
Perhaps it could, but it doesn't ("not supported by tools").
Hence it's incorrect to say that stdcall cannot or could
not support variadic number of arguments (as Igor did)
I only stated that stdcall, *as it exists today*, cannot support
variadic functions. Microsoft agrees:
http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx
"The __stdcall calling convention is used to call Win32 API functions.
The callee cleans the stack, so the compiler makes vararg functions
__cdecl."
I never stated that no modification of stdcall can possibly exist that
could support variadic functions (but it does appear to me that a few
such modifications I could think of are no better at supporting variadic
functions than an existing cdecl already is).
It could be argued that any modification to existing calling
convention - whether for the purpose of supporting variadic functions or
otherwise - should be given a different name (as was done with
__thiscall). You insist on calling it stdcall - and that's OK with me,
as long as you distinguish between stdcall as it is currently
implemented by VC compiler, and your hypothetical modified stdcall that
"could easily" exist (but, to the best of my knowledge, doesn't).
So it's relative, as most things are. ;-)
And thus perhaps calling participants that hold a different point of
view "stupid" or "liars" might not be such a good idea as it probably
seemed at the time. These terms sound pretty absolute to me.
I just wish the other two participants in this thread would stop
posting inane, idiotic, meaningless articles, engaging my
calling-names circuits all the time (or perhaps that's why they do
it, if so then it's not very nice of them).
Case in point.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925