Any compiler can do this differently, though, unless it is explicitly spec'd
in the PalmOS requirements or something, right? Couldn't I write my own
compiler for the Palm's chip that compiled using __stdcall, for example? So
I guess the deal here is that compilers for the Palm are not intended to be
object-code compatible, and each vendor supplies their own version of the
compiled SDK?
Just curious,
Will
-----Original Message-----
From: Adam Wozniak [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 14, 2000 1:01 PM
To: Palm Developer Forum
Subject: Re: Why no C calling convention specified?
"Meyer, Will" wrote:
> I'm trying to understand why none of the libraries I've seen for the Palm
> include explicit calling convention specifiers in their public headers?
How
> is it possible to reliably distribute a piece of compiled C code
potentially
> for use in other compilers without specifying this explicitly? Shouldn't
you
> be able to theoretically take that compiled code to another compiler,
change
> the default calling convention used by that compiler, and get every call
> into one of the compiled functions to hose the stack? I suppose the issue
is
> that everyone stipulates the compiler to use with their library (I'm not
> even sure if the object code is compatible between gcc and mw, (COFF, OMF,
> what?)? So a varargs function like StrPrintF, distributed in object code,
> would crash if you somehow managed to get the compiler to compile calls to
> it using __stdcall, given that it's prototype doesn't include __cdecl. If
> anyone has any thoughts on the topic...perhaps you could enlighten me ;-)
Resistance is futile. You will be assimilated.
As far as I know there is only one calling convention. All else is
discouraged.
You don't need to specify it because there aren't several to choose from.
--
Adam Wozniak Senior Software Design Engineer
Surveyor Corporation
[EMAIL PROTECTED] 4548 Broad Street
[EMAIL PROTECTED] San Luis Obispo, CA 93401
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html