Boost logo

Boost :

From: Glen Knowles (gknowles_at_[hidden])
Date: 2001-11-14 14:29:32


I have worked on embedded systems where one of the most common errors during
development was out of memory. We were able to use a streaming interface for
error logging by using macros that expanded to something along the lines of:

extern char error_buffer[500];

if (error) {
  ostrstream os(error_buffer, sizeof(error_buffer));
  os << "Error message" << ends;
  error_handler(error_buffer, __FILE__, __LINE__);
}

-----Original Message-----
From: David Abrahams [mailto:david.abrahams_at_[hidden]]
Sent: Wednesday, November 14, 2001 9:24 AM
To: boost_at_[hidden]
Subject: Re: [boost] Re: Boost.Assert

From: "Ullrich Koethe" <u.koethe_at_[hidden]>

> > My 2 cents: I worry a little about any error detection mechanism that
> > requires the allocation of resources. In particular, this streaming
> > interface looks on the surface like it could throw an exception before
the
> > intended error is reported.
> >
>
> You are right, but any decent error reporting scheme will require
> allocation of some ressources. It's a tradeoff between convenience and
> safety, and I would probably vote on the convenience side.

I'm not certain: isn't it possible to used some kind of fixed-size buffer
for this? I'd be content if the resources only needed to be allocated once,
at startup.

Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk