John Marshall wrote:

> > double test1 = 0.2;
> > int test2 = 5;
> >
> > StrIToA(debugstring1, (int) (0.2 > 5));
> > StrIToA(debugstring2, (int) (test1 > test2));
>
> If StrIToA is not causing link errors, it must be that there is a
> declaration in scope to tell the compiler it's a systrap.  Let's assume
> that Nathan isn't psychotic and so didn't declare it himself, so that
> declaration is the prototype from StringMgr.h.

I never took that assumption.  That it is from StringMgr.h.  I'll follow your lead if 
you are making that assumption.

> Thence, since there's a prototype in scope, even if the parameter were not an Int32, 
>it'd get converted to one before StrIToA was
> called.

This hasn't been my experience with all C compilers.

> That typecasting you added isn't changing anything at all.  (Well, except that 
>adding your typecast to `StrIToA (buf, 65540)'
> would *introduce* a bug.)

To let you know where this is coming from, I have found this to be very useful when 
working with quasi-compliant C compilers; mostly
from the 8-bit microcontroller world.  That typecasting I have done has avoided many a 
compiler bug since to due a lot of
non-standard implementations.  Many compilers that don't have the ANSI seal of 
approval uses explicit typecasting for just the
problems that have been mentioned.

>     John   "Good grief.  Is it Friday afternoon yet?  :-)"

When it is, I'll buy the first round since we both have offices in Santa Clara.  :)

Steve



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to