"Greg Lutz" <[EMAIL PROTECTED]> wrote in message
news:66595@palm-dev-forum...
>
> Support for the Standard C++ Library is expanded under
> CodeWarrior 8.0, which we heartily applaud. But we run into a
> little problem: many error conditions within the template library
> are reported via the function __msl_error(), and (at least if you
> don't have exceptions enabled) the definition of that function,
> in (MSL for Palm OS)/MSL_C++/MSL_Common/Include/mslconfig),
> invokes fprintf(). So you can't use standard C++ templates
> without linking in the StdIO code. Before CodeWarrior 7.0, we
> "solved" that problem by defining a do-nothing fprintf()
> function. CW 7.0 had some built-in solution to the problem, I
> forget what. How can we solve it under 8.0? We *don't* want to
> be a Standard I/O app.
This is actually a problem I didn't think about when doing the re-port
in CW Palm 8. Mainly this was due to me not knowing enough about the
error reporting mechainsm in the C++ library. All of my tests were done
with exceptions turned on, so I didn't hit this problem... I'm sorry for
the oversight.
__msl_error should be defined differently for Palm OS. The current
mslconfig doesn't have a way to override this, but I'll get the MSL team
to add a method and fix it in the 8.1 update.
In the meantime, you can manually modify the __msl_error call to use a
Palm OS call.
inline void
_STD::__msl_error(const char* str)
{
ErrFatalDisplay(str);
}
seems to be a good choice, although its not great, since it always will
output the same file and line number.
> A related, and less serious, problem, is what to do about
> sprintf. It appears to work perfectly well to simply
>
> #define sprintf StrPrintF
This isn't perfect, since the Palm OS StrPrintF doesn't support the full
range of formatting options that the ISO C function sprintf supports.
I'd like to port our MSL sprintf implementation, but I've worked in that
code before, and the current implementation is tied to a file data
structure that seems a bit too large, both in memory use and code size.
However, I'll go back in and see just how bulky this would be for the
8.1 patch.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/