public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Craig Howland <howland@LGSInnovations.com>
To: <newlib@sourceware.org>
Subject: Re: printf() and _write() in newlib-nano
Date: Wed, 19 Apr 2017 15:17:00 -0000	[thread overview]
Message-ID: <f68eb55a-284c-aa70-af0f-e9e594546f11@LGSInnovations.com> (raw)
In-Reply-To: <02d116cb-f9a6-8f0c-8ab2-8dda8cec8f37@powersoft.it>

On 04/19/2017 04:55 AM, massimiliano cialdi wrote:
> I use newlib-nano in an embedded project.
> I have implemented my version of _write() to make printf() output chars to UART.
>
> I wonder if a single call of printf() results in a single call of _write(), 
> or, otherwise _write() can be called more than once by printf().
>
> best regards
>
> Max 
It depends on many factors (the actual print string, buffered, line buffered, 
text mode, etc.), but either alternative can happen--either one _write per print 
or more than one.  It can range from one write per print to one per character.  
If it is important to you, it probably would be best to instrument it to find 
out directly, and you could observe how it varies.

      reply	other threads:[~2017-04-19 15:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19  8:55 massimiliano cialdi
2017-04-19 15:17 ` Craig Howland [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=f68eb55a-284c-aa70-af0f-e9e594546f11@LGSInnovations.com \
    --to=howland@lgsinnovations.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).