W
Walter Roberson
And I showed Eric and you and Thompson that is supported
on gcc/MSVC/Lcc-win/Watcom/Borland and what have you
The searching I did indicated that the __stdcall ABI is used only
on Windows32 (and has some discrepancies between different compilers
and compilation modes even there.) I did not find any Unix type
platforms that support it, though I did find explicit statements
that it is -not- supported on Linux.
With regards to gcc,
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function-Attributes
The keyword __attribute__ allows you to specify special
attributes when making a declaration. This keyword is followed
by an attribute specification inside double parentheses. The
following attributes are currently defined for functions on all
targets: aligned, alloc_size, noreturn, returns_twice,
noinline, always_inline, flatten, pure, const, nothrow,
sentinel, format, format_arg, no_instrument_function, section,
constructor, destructor, used, unused, deprecated, weak,
malloc, alias, warn_unused_result, nonnull, gnu_inline,
externally_visible, hot, cold, artificial, error and warning.
Several other attributes are defined for functions on
particular target systems.
Notice that stdcall is not amongst the ones defined for all targets.
stdcall
On the Intel 386, the stdcall attribute causes the compiler to
assume that the called function will pop off the stack space
used to pass arguments, unless it takes a variable number of
arguments.
Notice the platform specification in the description.
I would have to dig further to find out what happens if you
use an attribute not supported for a particular platform. My
hypothesis at the moment is that the attribute is ignored.
That would make it legal in gcc to use the stdcall attribute
when compiling on Linux -- it would just have no effect.
And for those of us not using gcc and not compiling on Windows... ?