Neil 0 Posted November 24, 2008 Report Share Posted November 24, 2008 (edited) Hi All I think this shows a lib / compiler bug. If you run this code in the debuger (and on a real PIC18F) then the 32 bit function produces an error. sprintf32 gives 999 sprintf gives 9999 So, sprintf32 misses out one digit. It only seems to do this for numbers over 99. I have not looked at negative numbers Can this be confirmed as a bug? If so can it be fixed? Thanks Neil OS XPpro, BoostC++ 6.90 PIC18f8722 char buf[64]; char* bufP = buf; unsigned long tl = 9999; sprintf32(bufP, "%d", tl); unsigned int ti = 9999; sprintf(bufP, "%d", ti); I know I dot need bufP but this helps the debugger show the text string in the watch window. I have now compiled the sprintf32 code in libc and this works just fine for me. Edited August 21, 2012 by Pavel fixed "funny" characters in the sample code Quote Link to post Share on other sites
rdh8 0 Posted August 20, 2012 Report Share Posted August 20, 2012 This is the only reference to sprintf32 I can find. When I try and compile using this command I get this error: error: unknown identifier 'sprintf32' What am I missing here?? Thanks, Robert Quote Link to post Share on other sites
Reynard 0 Posted August 21, 2012 Report Share Posted August 21, 2012 Hi Robert, The manual says it is included in stdio.h. Have you included this header file into your code ? Cheers Reynard Quote Link to post Share on other sites
rdh8 0 Posted August 21, 2012 Report Share Posted August 21, 2012 Thanks. That helped me realize I loaded an old version that didn't have that function yet. Robert Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.