[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] Interested in 64-bit printf support?

From: Joerg Wunsch
Subject: Re: [avr-libc-dev] Interested in 64-bit printf support?
Date: Tue, 6 Dec 2016 08:20:13 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

As George Spelvin wrote:

> I suggest adding it to "standard".  It would add *very* little code.

That's even better to hear.

> As I mentioned, the cleanest way to do this is to change the argument
> handling in vfprintf() to use a pointer & size (to the argument on the
> stack), rather than a copy of the value.

I don't mind any changes like that.

> The only overhead is needing a 20-byte (or 22-byte, for octal) buffer
> on the stack, rather than the current 11-byte one.

Given that people using printf() usually don't use something as small
as an ATtiny13 (with only 64 bytes of RAM), I think that's not an
issue here.  We might document this as one of the differences between
the minimal and the standard version then.

I think, overall, having useable printf() support in avr-libc is one
of the features that make using the AVR a nice job, so making it more
useful is a Good Thing.  There are always people who "as a matter of
principle" believe printf() is evil on a small controller, though I
bet, the majority of them would actually produce larger code by
rolling their own formatting and output functions. ;-)
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

Never trust an operating system you don't have sources for. ;-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]