[ros-kernel] stdcall

Mike Nordell tamlin at algonet.se
Sat Feb 7 12:16:35 CET 2004


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.
>
> Thoughts?

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).

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.

Had there been a standard (ANSI/ISO C 89) predefined macro to check for
default calling convention, to be able to #error if that was not in effect
for the source- and/or header-files assuming it, my position would possibly
have been different. But since there is no such check possible...

Maybe I'm just overly cautious, but I prefer the old-and-explicit way of
displaying calling convention used for each and every function.


My 0.02

/Mike



More information about the Ros-kernel mailing list