public inbox for
 help / color / mirror / Atom feed
From: Chris Johns <>
To: Kenneth Porter <>
Cc: Embedded C++ <>
Subject: Re: iostreams (was template bloat)
Date: Thu, 27 Aug 1998 17:36:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Kenneth Porter wrote:
> On Thu, 27 Aug 1998 13:04:18 +0200, Michael Bruck wrote:
> >I know I have always negative examples ... but first thing I noticed when I
> >tried to use the STL for embedded modules was that there are some
> >places where it uses iostreams. (f.e. in the new operator). Thats why I
> >had to modify (means remove) some things to work without them. I have
> >not yet looked at the impact that it has on code size and placement.
> What impact does iostreams (classic or STL) have on code size, as
> compared to stdio? I'm sure most of us cut our teeth on printf and find
> stream inserters to be difficult to get used to, but they have the
> benefit of adapting to new types by defining an inserter for the new
> type, and printf lacks a mechanism for automatically type-checking its
> parameters and making sure the right number were passed. What cost must
> we pay for the convenience of type-safety?

iostream goes beyond just a printf replacement with type-safety. It
allows all sorts of stream management and control to be performed. I see
very little need for this in an embedded system.

We use a cout object which maps to printf to give us just an "iostream
printf". It allows basic cout operations to be portable with out the
cost of embedding the full iostream library.

The last time I look at iostream sizes was about 4 years ago with a
cfront 2.x version of iostream. It was over 32k. The C printf code was
about 3k. This means an increase of 10 times.

The printf based cout adds about 3k, but I would have to check this to
be certain.

 Chris Johns  Networks, Plessey Asia Pacfic Pty. Ltd.

  reply	other threads:[~1998-08-27 17:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-27 16:40 Kenneth Porter
1998-08-27 17:36 ` Chris Johns [this message]
1998-08-27 20:59 Kenneth Porter
1998-08-28  5:55 P.J. Plauger
1998-08-28 19:08 Michael Bruck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).