[Icc-avr] printf off by 1?

bobgardner at aol.com bobgardner at aol.com
Wed Jul 2 17:00:44 PDT 2008


Well that's the problem... mixing ints and chars.... each is a user cfg item... I had a version that did a read and write eeprom for each item, but I was running out of flash.... so I thought I was being clever by writing the whole bunch of them with one call.?

-----Original Message-----
From: Richard Man <richard-lists at imagecraft.com>
To: icc-avr at imagecraft.com
Sent: Wed, 2 Jul 2008 4:34 pm
Subject: Re: [Icc-avr] printf off by 1?


Bob, not sure what you mean by one byte off, or off by one, but ALL variable argument functions such as printf, relies on the Standard C's rule of argument promotion, e.g. any "char" arguments to printf are promoted to int.?
?
Hope this helps.?
?
At 08:44 AM 7/2/2008, bobgardner at aol.com wrote:?
>Anyone see anything that would make this print out one byte off? The >var sizes are mixed... 1 byte, 2 byte.... but the cprintf that prints em out?
>thinks they are all 2 byte? How does a %d know if it has a byte or >an int for a param?? Sorry about losing the indent.... hope its not >too wierd to read....?
?
// richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com) ?
_______________________________________________?
Icc-avr mailing list?
Icc-avr at imagecraft.com?
http://dragonsgate.net/mailman/listinfo/icc-avr?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080702/69bb6aee/attachment.html


More information about the Icc-avr mailing list