[ros-kernel] stdcall
Vizzini
vizzini at plasmic.com
Sat Feb 7 11:32:21 CET 2004
On Sat, 2004-02-07 at 05:16, Mike Nordell wrote:
> Vizzini wrote:
>
> > What about adding -mrtd to the default compiler options in our build
> > system? This is what the Microsoft ddk build system uses (well, it's
> > /Gz on MS). This prevents having to remember to add NTAPI or WINAPI or
> > whatever the current stdcall decoration is.
> While I feel sympathy for being forced to do this on most functions, I'm
> really no great fan of such implicit function-type
> declaration-and-definition changes. One very simple reason is that C by its
> very definition have C calling conventions. This switch makes C source code
> be generated into binaries not compatible with C (calling convention).
This is true. A counter-point might be that all windows API functions
(including DDK functions) are listed on MSDN, in the SDK, and sometimes
even in .h files, without the __stdcall decoration. That would seem to
cause more confusion than changing cdecl. In fact, the very fact that
they ommit the __stdcall decoration supports the idea that MS api code
expects the compiler's default calling convention to be stdcall.
> I also fear it might be a little late. Starting to use this now, where
> people have come to assume a function declaration can be trusted, new code
> using this assumption-switch would no longer have those explicitly
> documenting calling-convention "wharts", making it look for someone used to
> the current explicit declarations like the new code is using C calling
> convention.
If there is an explicit convention specified, the default will not
override it, so currently-decorated code will continue to work fine.
Anything in the ReactOS source that expects cdecl *should* be decorated
as such, as that is not the standard for Microsoft interfaces.
My $0.02 anyway.
-Vizzini
More information about the Ros-kernel
mailing list