From: SourceForge.net <no...@so...> - 2007-08-23 09:33:06
|
Bugs item #1774346, was opened at 2007-08-14 21:43 Message generated for change (Comment added) made by tecodev You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1774346&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: pic16 target >Group: known bugs >Status: Pending >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Tom (motratiug) Assigned to: Nobody/Anonymous (nobody) Summary: sprintf fails to read some format specifiers Initial Comment: sprintf does not appear to correctly implement format specifiers including width characters: sprintf(cBuffer, "%03d", 4); produces 0x30 0x33 0x00 rather than the expected 0x30 0x30 0x34. Compiled using: sdcc -mpic16 -p18f2320 7seg-sp.c sdcc version: SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.7.0 #4818 (May 31 2007) (MINGW32) using gputils: gpasm-0.13.4 beta gplink-0.13.4 alpha Apologies for the size of the attached code, however I wanted to make sure I didn't drop anything important by editing it for this report. ---------------------------------------------------------------------- >Comment By: Raphael Neider (tecodev) Date: 2007-08-23 09:33 Message: Logged In: YES user_id=1115835 Originator: NO The pic16 library sources indicate that the supported format specifiers (for vfprintf, which is used to implement the whole *printf-family) comprise %%, %[u]hb, %[u]b, %[u]lb, %[u]hd, %[u]d, %[u]ld, %[u]hx, %[u]hX, %[u]x, %[u]X, %[u]lx, %[u]lX, %[u]ho, %[u]o, %[u]lo, %c, and %s, where `u' is an optional modifier indicating unsigned values, `h' denotes byte wide arguments (8 bit), `l' long arguments (32 bit) and no modifier standard int (16 bit) arguments, which are emitted as (b)inary, (d)ecimal, he(x)adecimal in lower- or uppoercase letters, or (o)ctal besides the literal (%) sign output, a single ASCII (c)haracter or a NUL terminated (s)tring. Width and padding modifiers are nit supported by the PIC16 library version---feel free to use a different implementation, just link it prior to the library to your project. If I should happen to come up with a compact fully fledged, SUSv3 and POSIX compatible printf implementation, I will add it to the library... or sell it for muuuch money ;-) Regards, Raphael Not sure how to proceed: is this a feature request? really a bug, despite being documented in the sources?!? Setting this to pending... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1774346&group_id=599 |