in article 38903@palm-dev-forum, [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote
on 2/9/01 12:55 AM:

greetings keith,

sorry, addled brain. i should have pasted in the context code as well. Yes,
"money" is an int, an Int16 to be exact. My NON-NULL comment was referring
to the Char* which is what object->GetName() would be returning which is
where I assumed the bus error was originating from.

Well, it looks like that helped. I switched from using %ld to %d and it
doesn't crash anymore.

I guess I have always assumed that it was safe to print to use %ld (on other
platforms, I've been able to inter-change %ld and %d with no consequences).
Guess I will need to change my asssumption!

Do you (or does anyone else) know where I can find more information on the
ShellCmd.h functions specifically associated with printing out logging
information to the Console Window? I see the documentation on creating
commands for the Console Window. I was looking for more information on what
the remainder of the functions in that header file do (I can guess, mostly,
from their definition, but it would be nice to see some docs as well).

thanks for the help!
steve

> Well, what is "money"?  (And no, I don't mean that in a philosphical sense.)
> You say it's "non NULL".  Does that mean it's a pointer?  If so, then why are
> you printing it with %ld?  Is it really an integer?  If so, is it a plain old
> "int"?  If so, then that's a two-byte value, and you're trying to print it as
> a
> 
> 4-byte value, skewing up the varargs parsing.
> 
> Other than that, I'm out of guesses.
> 
> -- Keith Rollin
> -- Palm OS Emulator engineer
> 
> To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
> cc:    (Keith Rollin/US/PALM)
> Subject:  ShlPrintf bus error
> 
> greetings,
> 
> I am getting a bus error when I execute the following line of code...
> 
> ShlPrintf("money: $%ld, name: %s\n", money, object->GetName());
> 
> both money and object->GetName() are valid and non NULL. in fact, other
> combinations of this command work just fine (just the %ld, several %ld, just
> the %s).
> 
> Is there some problem with logging integers and strings to the console
> window in the same function?
> 
> in general, is there more documentation on using the Console window for
> printing out debug information programmatically? In ShellCmd.h there are
> functions that would appear to help, but there are no comments and I can't
> find any documentation on that part of the Console window. Just looking for
> some additional info.


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